Here you can find the source of getExceptionAsString(Throwable _ex)
private static String getExceptionAsString(Throwable _ex)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayOutputStream; import java.io.PrintStream; public class Main { private static String getExceptionAsString(Throwable _ex) { if (_ex == null) { return null; }/* w w w .j av a 2s .c o m*/ ByteArrayOutputStream baos = new ByteArrayOutputStream(); if (_ex.getStackTrace() == null) { _ex.fillInStackTrace(); } _ex.printStackTrace(new PrintStream(baos)); return baos.toString(); } }