org.apache.avalon.composition.util
Class ExceptionHelper

java.lang.Object
  extended byorg.apache.avalon.composition.util.ExceptionHelper

public class ExceptionHelper
extends Object

General utilities supporting the packaging of exception messages.

Author:
Stephen McConnell

Constructor Summary
ExceptionHelper()
           
 
Method Summary
static String packException(String message, Throwable e)
          Returns the exception and causal exceptions as a formatted string.
static String packException(String message, Throwable e, boolean stack)
          Returns the exception and causal exceptions as a formatted string.
static void printException(String label, Throwable e)
          Prints the exception to the standard error out together with cause statements.
static void printException(String label, Throwable e, Object source)
          Prints the exception to the standard error out together with source and cause statements.
static void printException(String label, Throwable e, Object source, boolean trace)
          Prints the exception to the standard error out together with source and cause statements.
static void printException(Throwable e)
          Prints the exception to the standard error out together with cause statements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHelper

public ExceptionHelper()
Method Detail

printException

public static void printException(Throwable e)
Prints the exception to the standard error out together with cause statements.

Parameters:
e - the exception to print

printException

public static void printException(String label,
                                  Throwable e)
Prints the exception to the standard error out together with cause statements.

Parameters:
label - label identifying the error
e - the exception to print

printException

public static void printException(String label,
                                  Throwable e,
                                  Object source)
Prints the exception to the standard error out together with source and cause statements.

Parameters:
label - label identifying the error
e - the exception to print
source - the source of the request

printException

public static void printException(String label,
                                  Throwable e,
                                  Object source,
                                  boolean trace)
Prints the exception to the standard error out together with source and cause statements.

Parameters:
label - label identifying the error
e - the exception to print
source - the source of the request
trace - boolean value inidication if a stack trace though be included

packException

public static String packException(String message,
                                   Throwable e)
Returns the exception and causal exceptions as a formatted string.

Parameters:
message - the header message
e - the exception
Returns:
String the formatting string

packException

public static String packException(String message,
                                   Throwable e,
                                   boolean stack)
Returns the exception and causal exceptions as a formatted string.

Parameters:
message - the header message
e - the exception
Returns:
String the formatting string


Copyright © Apache Software Foundation. All Rights Reserved.