String msg = targetException.getMessage();
StackTrace trace = buildTrace(targetException, rascalTrace);
Throwable cause = targetException.getCause();
if (cause != null && cause != targetException) {
Throw throwCause = cause instanceof Throw ? (Throw) cause : javaException(cause, ast, rascalTrace);
return javaException(clazz, msg != null ? msg : "", throwCause.getException(), ast, trace);
}
else {
return javaException(clazz, msg != null ? msg : "", ast, trace);
}
} catch (IOException e1) {