Fixed exception conversion in DataStreamerImpl.
authorsboikov <sboikov@gridgain.com>
Fri, 16 Jun 2017 06:36:40 +0000 (09:36 +0300)
committerdevozerov <vozerov@gridgain.com>
Fri, 16 Jun 2017 12:09:46 +0000 (15:09 +0300)
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java

index 48cacca..a991385 100644 (file)
@@ -659,15 +659,18 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
         else
             checkSecurityPermission(SecurityPermission.CACHE_PUT);
 
-        try {
-            KeyCacheObject key0 = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, key, true);
-            CacheObject val0 = cacheObjProc.toCacheObject(cacheObjCtx, val, true);
+        KeyCacheObject key0;
+        CacheObject val0;
 
-            return addDataInternal(Collections.singleton(new DataStreamerEntry(key0, val0)));
+        try {
+            key0 = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, key, true);
+            val0 = cacheObjProc.toCacheObject(cacheObjCtx, val, true);
         }
         catch (Exception e) {
             return new IgniteFinishedCacheFutureImpl<>(e);
         }
+
+        return addDataInternal(Collections.singleton(new DataStreamerEntry(key0, val0)));
     }
 
     /** {@inheritDoc} */