@Override
protected void doCatch(Throwable e) throws Throwable {
failed = true;
if (e instanceof WorkflowException) {
WorkflowException we = (WorkflowException) e;
throw new ChildWorkflowFailedException(0, childExecution, parameters.getWorkflowType(), e.getMessage(),
we.getDetails());
}
else if (e instanceof CancellationException) {
throw e;
}
// Unless there is problem in the framework or generic workflow implementation this shouldn't be executed
Exception failure = new ChildWorkflowFailedException(0, childExecution, parameters.getWorkflowType(), e.getMessage(),
"null");
failure.initCause(e);
throw failure;
}