Skip to content

Instantly share code, notes, and snippets.

@aziz781
Created November 3, 2011 12:53
Show Gist options
  • Save aziz781/1336413 to your computer and use it in GitHub Desktop.
Save aziz781/1336413 to your computer and use it in GitHub Desktop.
Convert Java Throwable exception stack trace into String
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