in src/main/java/org/apache/sling/servlets/resolver/internal/defaults/DefaultErrorHandlerServlet.java [203:224]
private void printStackTrace(PrintWriter pw, Throwable t) {
// nothing to do, if there is no exception
if (t == null) {
return;
}
// unpack a servlet exception
if (t instanceof ServletException) {
ServletException se = (ServletException) t;
while (se.getRootCause() != null) {
t = se.getRootCause();
if (t instanceof ServletException) {
se = (ServletException) t;
} else {
break;
}
}
}
// dump stack, including causes
t.printStackTrace(pw);
}