Here you can find the source of getStackTraceFromBaseException(Throwable exc)
public static String getStackTraceFromBaseException(Throwable exc)
//package com.java2s; import java.io.PrintStream; public class Main { public static String getStackTraceFromBaseException(Throwable exc) { String str = ""; try {/*from www.j a v a 2s .c o m*/ Exception be = (Exception) exc; //java.io.ByteArrayOutputStream java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos, false, "UTF8"); be.printStackTrace(ps); str = baos.toString("UTF8"); } catch (Exception e) { e.printStackTrace(); } return str; } }