void
dumpThrowable(final String additionalDescr, final Throwable t) Dumps a Throwable in a decorating message including the current thread name, and its #dumpStack(PrintStream,StackTraceElement[],int,int) stack trace .
System.err.println("Caught " + additionalDescr + " " + t.getClass().getSimpleName() + ": " + t.getMessage()
+ " on thread " + Thread.currentThread().getName());
dumpStack(System.err, t.getStackTrace(), 0, -1);
int causeDepth = 1;
for (Throwable cause = t.getCause(); null != cause; cause = cause.getCause()) {
System.err.println("Caused[" + causeDepth + "] by " + cause.getClass().getSimpleName() + ": "
+ cause.getMessage() + " on thread " + Thread.currentThread().getName());
dumpStack(System.err, cause.getStackTrace(), 0, -1);
...
String
dumpThrowable(Throwable e) Extracts the stack trace from the throwable to string.
if (e == null) {
return null;
if (e.getCause() != null) {
e = e.getCause();
StringWriter writer = new StringWriter();
e.printStackTrace(new PrintWriter(writer));
...