com.perdues
Class WrappedException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.perdues.WrappedException
All Implemented Interfaces:
java.io.Serializable

public class WrappedException
extends java.lang.RuntimeException

A RuntimeException to hold the state of any Throwable. This class allows a class to catch Exceptions or other Throwables that are not RuntimeExceptions and rethrow an exception that can display the stack trace and other information about the original problem. The printStackTrack methods print a header followed by the stack trace for the underlying Throwable.

See Also:
Serialized Form

Constructor Summary
WrappedException(java.lang.Throwable ex)
           
WrappedException(java.lang.Throwable ex, java.lang.String msg)
           
 
Method Summary
 java.lang.Throwable getException()
          Returns the Throwable wrapped inside this WrappedException.
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter pw)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedException

public WrappedException(java.lang.Throwable ex)

WrappedException

public WrappedException(java.lang.Throwable ex,
                        java.lang.String msg)
Method Detail

getException

public java.lang.Throwable getException()
Returns the Throwable wrapped inside this WrappedException.

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Overrides:
printStackTrace in class java.lang.Throwable

toString

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