Java Throwable to String stackTraceToString(Throwable t)

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

Description

stack Trace To String

License

Open Source License

Parameter

Parameter Description
t a parameter

Return

A stack trace as a string.

Declaration

private static String stackTraceToString(Throwable t) 

Method Source Code


//package com.java2s;
import java.io.PrintWriter;
import java.io.StringWriter;

public class Main {
    /**/*  ww w .j  a  va2  s .c o m*/
     * @param t
     * @return A stack trace as a string.
     */
    private static String stackTraceToString(Throwable t) {
        StringWriter sw = new StringWriter();
        t.printStackTrace(new PrintWriter(sw));
        return sw.getBuffer().toString();
    }
}

Related

  1. stackTraceToString(Throwable e)
  2. stackTraceToString(Throwable e)
  3. stackTraceToString(Throwable eIn)
  4. stackTraceToString(Throwable ex)
  5. StackTraceToString(Throwable ex)
  6. stackTraceToString(Throwable t)
  7. stacktraceToString(Throwable t)
  8. stackTraceToString(Throwable t)
  9. stackTraceToString(Throwable t)