Here you can find the source of stackTrace2String(Throwable e)
Parameter | Description |
---|---|
e | a parameter |
public static String stackTrace2String(Throwable e)
//package com.java2s; //License from project: Apache License public class Main { /**/*w w w .j a va 2 s. c o m*/ * make exception stack trace become string * * @param e * @return */ public static String stackTrace2String(Throwable e) { StringBuffer sb = new StringBuffer(); sb.append(e.toString()).append("\r\n"); StackTraceElement[] traces = e.getStackTrace(); for (StackTraceElement trace : traces) { sb.append(trace.toString()).append("\r\n"); } return sb.toString(); } }