Skip to content

Commit

Permalink
GEODE-5884: Restores behavior of exceptions/wrapping of exceptions (a…
Browse files Browse the repository at this point in the history
…pache#2786)


* Previous refactor in a5daa92 was causing behavioral changes
   with function exceptions when combining with GEODE-5884
  • Loading branch information
jhuynh1 authored Nov 6, 2018
1 parent b65b364 commit 0f517d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,7 @@ public static void executeFunctionFunctionInvocationTargetException_ClientServer
fail("Function Invocation Target Exception should be thrown");
} catch (Exception e) {
e.printStackTrace();
if (!((e instanceof FunctionInvocationTargetException)
|| (e.getCause() instanceof FunctionInvocationTargetException))) {
if (!(e.getCause() instanceof FunctionInvocationTargetException)) {
fail("FunctionInvocationTargetException should be thrown");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ public static void regionSingleKeyExecutionNonHA(Boolean isByName, Function func
fail("Expected ServerConnectivityException not thrown!");
} catch (Exception ex) {
if (!(ex.getCause() instanceof ServerConnectivityException)
&& !((ex instanceof FunctionInvocationTargetException
|| ex.getCause() instanceof FunctionInvocationTargetException))) {
&& !(ex.getCause() instanceof FunctionInvocationTargetException)) {
throw ex;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,22 @@ protected Object processResponse(Message msg) throws Exception {
}

private void addFunctionException(final FunctionException result) {
if (this.functionException == null) {
this.functionException = result;
if (result instanceof FunctionInvocationTargetException) {
if (this.functionException == null) {
this.functionException = new FunctionException(result);
}
this.functionException.addException(result);
} else if (result instanceof InternalFunctionInvocationTargetException) {
if (this.functionException == null) {
this.functionException = new FunctionException(result);
}
this.functionException.addException(result);
} else {
if (this.functionException == null) {
this.functionException = result;
}
this.functionException.addException(result);
}
this.functionException.addException(result);
}

@Override
Expand Down

0 comments on commit 0f517d3

Please sign in to comment.