Skip to content

Instantly share code, notes, and snippets.

@swarupdonepudi
Created April 19, 2018 14:55
Show Gist options
  • Save swarupdonepudi/3fea99a44cfa99e14c36fc71085c1d8c to your computer and use it in GitHub Desktop.
Save swarupdonepudi/3fea99a44cfa99e14c36fc71085c1d8c to your computer and use it in GitHub Desktop.
Converting Java stack trace to a string
public static String convertStackTraceToString(Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
return sw.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment