Java Throwable to String getExceptionString(Throwable throwable)

Here you can find the source of getExceptionString(Throwable throwable)

Description

getExceptionString

License

Open Source License

Parameter

Parameter Description
throwable Exception

Return

String

Declaration

public static String getExceptionString(Throwable throwable) 

Method Source Code

//package com.java2s;

import java.io.PrintWriter;
import java.io.StringWriter;

public class Main {
    /**//w  w  w. j a v a2 s.com
     * getExceptionString
     * 
     * @param throwable Exception
     * @return String
     */
    public static String getExceptionString(Throwable throwable) {
        StringWriter stringWriter = new StringWriter();
        throwable.printStackTrace(new PrintWriter(stringWriter));
        return stringWriter.toString();
    }
}

Related

  1. getExceptionStackTrace(Throwable ex)
  2. getExceptionStackTrace(Throwable exception)
  3. getExceptionStackTrace(Throwable exception)
  4. getExceptionString(Throwable e)
  5. getExceptionString(Throwable t)
  6. getExceptionText(Throwable e)
  7. getExceptionTrace(Throwable e)
  8. getStackTrace (final Throwable e)
  9. getStackTrace(@Nonnull final Throwable throwable)