com.anthonyeden.lib
Class ChainedRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.anthonyeden.lib.ChainedRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class ChainedRuntimeException
extends java.lang.RuntimeException

A chained runtime 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
ChainedRuntimeException(java.lang.String message, java.lang.Throwable nestedError)
          Create a new ChainedRuntimeException.
ChainedRuntimeException(java.lang.Throwable nestedError)
          Create a new ChainedRuntimeException using the message of the nested error as the exception message.
 
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

ChainedRuntimeException

public ChainedRuntimeException(java.lang.Throwable nestedError)
Create a new ChainedRuntimeException using the message of the nested error as the exception message.

Parameters:
nestedError - The nested error

ChainedRuntimeException

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

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.