Created
November 3, 2011 12:53
-
-
Save aziz781/1336413 to your computer and use it in GitHub Desktop.
Convert Java Throwable exception stack trace into String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getStackTrace(Throwable aThrowable) { | |
final Writer result = new StringWriter(); | |
final PrintWriter printWriter = new PrintWriter(result); | |
aThrowable.printStackTrace(printWriter); | |
return result.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment