in src/main/java/org/apache/freemarker/onlinetester/util/ExceptionUtils.java [35:51]
public static String getMessageWithCauses(final Throwable exc) {
StringBuilder sb = new StringBuilder();
Throwable curExc = exc;
while (curExc != null) {
if (curExc != exc) {
sb.append("\n\nCaused by:\n");
}
String msg = curExc.getMessage();
if (msg == null || !(curExc instanceof TemplateException || curExc instanceof ParseException)) {
sb.append(curExc.getClass().getName()).append(": ");
}
sb.append(msg);
curExc = curExc.getCause();
}
return sb.toString();
}