Java examples for java.lang:Exception StackTrace
get Stack Trace As String
//package com.java2s; import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static String getStackTraceAsString(Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw);/*w w w .j a va2s.c o m*/ return sw.toString(); } }