Here you can find the source of getExceptionText(Throwable e)
public static String getExceptionText(Throwable e)
//package com.java2s; /**// w w w . j a va 2 s . com * Util.java * @author John Green * 27-Oct-2002 * www.joanju.com * * Copyright (c) 2002 Joanju Limited. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * */ import java.io.*; public class Main { public static String getExceptionText(Throwable e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.print(e.toString() + "\n" + e.getMessage() + "\n"); e.printStackTrace(pw); return sw.toString(); } }