Here you can find the source of getStackTrace(Throwable aThrowable)
Parameter | Description |
---|---|
aThrowable | The a throwable. |
public static String getStackTrace(Throwable aThrowable)
//package com.java2s; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; public class Main { /**//from w w w .jav a 2 s. co m * Gets the stack trace. * * @param aThrowable * The a throwable. * @return The stack trace. */ public static String getStackTrace(Throwable aThrowable) { final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); aThrowable.printStackTrace(printWriter); return result.toString(); } }