public static String exceptionToString(Throwable throwable ) { try{ StringWriter stringWriter = new StringWriter(); throwable.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); }catch(Exception e){ // shouldn't happen but whatever return null; } }
Leave a Reply