Here you can find the source of getExceptionStack(Throwable e)
public static String getExceptionStack(Throwable e)
//package com.java2s; //License from project: Apache License import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static String getExceptionStack(Throwable e) { String msg = e.getMessage(); try {/*from ww w . jav a 2s . c om*/ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); msg = sw.toString(); } catch (Throwable e2) { msg = "bad getErrorInfoFromException"; } return msg; } }