Java Error Print printErrorInfo(Object e)

Here you can find the source of printErrorInfo(Object e)

Description

print Error Info

License

Open Source License

Declaration

static private String printErrorInfo(Object e) 

Method Source Code

//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;
    }
}

Related

  1. printError(String msg, Exception exception, boolean quit)
  2. printError(String s)
  3. printError(String s)
  4. printErrorAndExit(String message)
  5. printErrorFooter(String content)
  6. printErrorLine()
  7. printErrorln(String string)
  8. printErrorMessage(final String prg_name, final String message)
  9. printErrorMessage(String errorMessage)