static String stacktraceToString(Exception e) {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        String stackTrace = sw.toString();
        return stackTrace;
    }
static String stacktraceToString ( Exception e ) { StringWriter sw = new StringWriter ( ) ; e . printStackTrace ( new PrintWriter ( sw ) ) ; String stackTrace = sw . toString ( ) ; return stackTrace ; }
Extracts StackTrace from exception and translates it to a string

@param e
@return stackTrace