org.cyberlab.support.exception
Class CollectExceptions

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.cyberlab.support.exception.CollectExceptions
All Implemented Interfaces:
java.io.Serializable, ExceptionHandler

public class CollectExceptions
extends java.lang.Exception
implements ExceptionHandler

Exception helper class to collect a train of exceptions in order to correctly represent the exception stack with the "causing" exception on top of the stack. This should allow for more accurate and effective debugging.

Author:
Mats-Gøran Karlsen
See Also:
Serialized Form

Constructor Summary
CollectExceptions()
           
 
Method Summary
 boolean containsErrors()
           
 java.lang.String getMessage()
           
 java.lang.StackTraceElement[] getStackTrace()
           
 void handle(java.lang.String errorMessage, java.lang.Exception e)
          The exception handle method
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectExceptions

public CollectExceptions()
Method Detail

handle

public void handle(java.lang.String errorMessage,
                   java.lang.Exception e)
Description copied from interface: ExceptionHandler
The exception handle method

Specified by:
handle in interface ExceptionHandler
Parameters:
errorMessage - A string containig the cause of the error.
e - The exception thrown.

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

getStackTrace

public java.lang.StackTraceElement[] getStackTrace()
Overrides:
getStackTrace in class java.lang.Throwable

containsErrors

public boolean containsErrors()