Here you can find the source of getExceptionString(Throwable throwable)
Parameter | Description |
---|---|
throwable | Exception |
public static String getExceptionString(Throwable throwable)
//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(); } }