What is the easiest way to convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace?
Throwable.getStackTrace()
Scala version
def stackTraceToString(e: Exception): String = { import java.io.PrintWriter val sw = new StringWriter() e.printStackTrace(new PrintWriter(sw)) sw.toString }