Guest User

Untitled

a guest
May 20th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. /**
  2. * Transforms a Exception stack trace into String.
  3. * @param e The exception to be transformed.
  4. * @return A string with the stack trace text.
  5. */
  6. public String exception2String(Exception e) {
  7.  
  8. StringWriter sw = new StringWriter();
  9. PrintWriter pw = new PrintWriter(sw);
  10. e.printStackTrace(pw);
  11. return pw.toString();
  12. }
Add Comment
Please, Sign In to add comment