Here you can find the source of printErrorInfo(Object e)
static private String printErrorInfo(Object e)
//package com.java2s; /******************************************************************************* * Copyright (c) 2006-2010 eBay Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 *******************************************************************************/ public class Main { static private String printErrorInfo(Object e) { String causeText;//from w w w. j a v a 2 s.c om if (e instanceof Throwable) { ((Throwable) e).printStackTrace(); causeText = e.toString(); } else { causeText = e.toString(); } System.err.println("ErrorInfo: " + causeText); return causeText; } }