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..061cd3a6e 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 @@ -150,7 +150,11 @@ public Object decompose(Graph graph) { Throwable throwable = newThrowable(clazz, getMessage()); Throwable cause = (Throwable)graph.decomposeReference(getCause()); if (cause != null) { - throwable.initCause(cause); + try { + throwable.initCause(cause); + } catch (IllegalStateException e) { + throwable = new RuntimeException(clazz.getName() + ": " + getMessage(), cause); + } } Object[] array = (Object[])graph.decomposeReference(getStackTrace()); if (array != null) {