public static String toString(Throwable e){
  StringWriter sw=new StringWriter();
  e.printStackTrace(new PrintWriter(sw));
  return sw.toString();
}

public static String toString ( Throwable e ) { StringWriter sw = new StringWriter ( ) ; e . printStackTrace ( new PrintWriter ( sw ) ) ; return sw . toString ( ) ; }
gets the stack trace as a string . handy for looking inside exceptions when debugging .
