Skip to content

Commit

Permalink
IGNITE-8926 : Fixed incorrect exception handling due to wrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilantukh authored and mcherkasov committed Aug 9, 2018
1 parent 278a83d commit a7dfedd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.ignite.binary.BinaryReflectiveSerializer;
import org.apache.ignite.binary.BinarySerializer;
import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.internal.UnregisteredBinaryTypeException;
import org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller;
import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
import org.apache.ignite.internal.processors.query.QueryUtils;
Expand Down Expand Up @@ -823,6 +824,9 @@ void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException {
}
}
catch (Exception e) {
if (e instanceof UnregisteredBinaryTypeException)
throw e;

String msg;

if (S.INCLUDE_SENSITIVE && !F.isEmpty(typeName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.internal.GridDirectCollection;
import org.apache.ignite.internal.GridDirectTransient;
import org.apache.ignite.internal.UnregisteredBinaryTypeException;
import org.apache.ignite.internal.UnregisteredClassException;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.CU;
Expand Down Expand Up @@ -243,9 +244,13 @@ public synchronized void addEntryProcessResult(
v = resMap;
}

// This exception means that we should register class and call EntryProcessor again.
if (err != null && err instanceof UnregisteredClassException)
throw (UnregisteredClassException) err;
// These exceptions mean that we should register class and call EntryProcessor again.
if (err != null) {
if (err instanceof UnregisteredClassException)
throw (UnregisteredClassException) err;
else if (err instanceof UnregisteredBinaryTypeException)
throw (UnregisteredBinaryTypeException) err;
}

CacheInvokeResult res0 = err == null ? CacheInvokeResult.fromResult(res) : CacheInvokeResult.fromError(err);

Expand Down

0 comments on commit a7dfedd

Please sign in to comment.