Android Throwable to String Convert stringify(Throwable t)

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

Description

stringify

Declaration

public static String stringify(Throwable t) 

Method Source Code

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

public class Main {
    public static String stringify(Throwable t) {
        if (t == null) {
            return null;
        }/*from  w  w  w . j  a  v  a 2  s  .c  om*/
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        t.printStackTrace(pw);
        return sw.toString();
    }
}

Related

  1. getExceptionMessage(Throwable e)
  2. getExceptionMessage(Throwable ex)
  3. exceptionToString(Throwable t)
  4. failException(String message, Throwable got)