Java Stacktrace to String stackTraceToString(Throwable e)

Here you can find the source of stackTraceToString(Throwable e)

Description

stack Trace To String

License

LGPL

Declaration

public static final String stackTraceToString(Throwable e) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static final String stackTraceToString(Throwable e) {
        StringBuilder sb = new StringBuilder();
        for (StackTraceElement element : e.getStackTrace()) {
            sb.append(element.toString());
            sb.append("\n");
        }/*  ww  w.  j  a va2s. co m*/
        return sb.toString();
    }
}

Related

  1. stackTraceToString(StackTraceElement[] ste)
  2. stackTraceToString(StackTraceElement[] trace)
  3. stackTraceToString(StackTraceElement[] trace)
  4. stackTraceToString(Throwable e)
  5. stackTraceToString(Throwable e)
  6. stackTraceToString(Throwable throwable)