com.anthonyeden.lib
Class ChainedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.anthonyeden.lib.ChainedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConfigurationException, LockException, ResourceException

public class ChainedException
extends java.lang.Exception

A chained exception allows a parent exception to be specified and accessible through the getNestedError() method and will appear in stack traces.

Author:
Anthony Eden
See Also:
Serialized Form

Constructor Summary
ChainedException(java.lang.String message, java.lang.Throwable nestedError)
          Create a new ChainedException.
 
Method Summary
 java.lang.Throwable getNestedError()
          Return the parent exception.
 void printStackTrace()
          Print the stack trace to System.err
 void printStackTrace(java.io.PrintStream out)
          Print the stack trace.
 void printStackTrace(java.io.PrintWriter out)
          Print the stack trace.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedException

public ChainedException(java.lang.String message,
                        java.lang.Throwable nestedError)
Create a new ChainedException.

Parameters:
message - The message
nestedError - The parent exception
Method Detail

getNestedError

public java.lang.Throwable getNestedError()
Return the parent exception.

Returns:
The parent exception

printStackTrace

public void printStackTrace()
Print the stack trace to System.err


printStackTrace

public void printStackTrace(java.io.PrintStream out)
Print the stack trace.

Parameters:
out - The output stream

printStackTrace

public void printStackTrace(java.io.PrintWriter out)
Print the stack trace.

Parameters:
out - The output writer


Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.