From 2db4304f35c48de18c5570b7af880364073cb7ff Mon Sep 17 00:00:00 2001 From: Victor Verbitsky Date: Thu, 10 Jul 2014 20:00:42 +0400 Subject: [PATCH] Return the throwable instead of throw it. Pass through the throwable with unknown class. --- .../org/switchyard/serial/graph/node/ThrowableNode.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/serial/base/src/main/java/org/switchyard/serial/graph/node/ThrowableNode.java b/serial/base/src/main/java/org/switchyard/serial/graph/node/ThrowableNode.java index 910d76021..a51867ec9 100644 --- a/serial/base/src/main/java/org/switchyard/serial/graph/node/ThrowableNode.java +++ b/serial/base/src/main/java/org/switchyard/serial/graph/node/ThrowableNode.java @@ -177,7 +177,11 @@ private Throwable newThrowable(Class throwableClass, String throwable = Construction.construct(throwableClass, parameterTypes, new Object[]{message}); } } catch (Throwable t) { - throw SerialMessages.MESSAGES.couldNotInstantiateThrowable(throwableClass.getName()); + if (throwableClass == null) { + return SerialMessages.MESSAGES.couldNotInstantiateThrowable("Unknown exception: " + message); + } else { + return SerialMessages.MESSAGES.couldNotInstantiateThrowable(throwableClass.getName() + ": " + message); + } } return throwable; }