List of utility methods to do Throwable to String
String | stackTraceToString(Throwable th) stack Trace To String PrintStream ps = null; try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ps = new PrintStream(out); if (th != null) th.printStackTrace(ps); return new String(out.toByteArray()); } finally { ... |
String | stackTraceToString(Throwable throwable) Retrieve the stack trace from the given Throwable, and output the string. final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); throwable.printStackTrace(printWriter); return result.toString(); |