Created
December 16, 2013 16:15
-
-
Save parzonka/7989659 to your computer and use it in GitHub Desktop.
Gets the stack trace from the given throwable.
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
/** | |
* Gets the stack trace from the given throwable. | |
* | |
* @param throwable | |
* a throwable | |
* @return stack trace as string | |
*/ | |
public static String getStackTrace(Throwable throwable) { | |
final StringWriter stringWriter = new StringWriter(); | |
throwable.printStackTrace(new PrintWriter(stringWriter)); | |
return stringWriter.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment