String (final String header, Throwable ex) { StringWriter stringWriter = new StringWriter(); stringWriter.write(header); stringWriter.write(":\n"); ex.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.getBuffer().toString(); }