Package com.day.util
Class WrappedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.day.util.WrappedException
-
- All Implemented Interfaces:
Serializable
public abstract class WrappedException extends Exception
An Exception that wraps another Throwable, and prints its wrapped exception's stack trace as well as its own when printStackTrace is called.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrappedException(String s)Class constructor that creates aWrappedExceptiongiven a message describing the failure causeWrappedException(String s, Throwable e)Class constructor that creates aWrappedExceptiongiven a message describing the failure cause and a root exceptionWrappedException(Throwable t)Class constructor that creates aWrappedExceptiongiven a root exception
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessage()Returns the error message string of this exception.ThrowablegetRootException()Returns the root exception of this exception.voidprintStackTrace()Prints thisWrappedExceptionand its backtrace to the standard error stream.voidprintStackTrace(PrintStream s)Prints thisWrappedExceptionand its backtrace to the specified print stream.voidprintStackTrace(PrintWriter s)Prints thisWrappedExceptionand its backtrace to the specified print writer.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
-
-
-
Constructor Detail
-
WrappedException
public WrappedException(String s)
Class constructor that creates aWrappedExceptiongiven a message describing the failure cause- Parameters:
s- description
-
WrappedException
public WrappedException(String s, Throwable e)
Class constructor that creates aWrappedExceptiongiven a message describing the failure cause and a root exception- Parameters:
s- descriptione- root failure cause
-
WrappedException
public WrappedException(Throwable t)
Class constructor that creates aWrappedExceptiongiven a root exception- Parameters:
t- root failure cause
-
-
Method Detail
-
getMessage
public String getMessage()
Returns the error message string of this exception.- Overrides:
getMessagein classThrowable- Returns:
- error message string of this exception.
-
getRootException
public Throwable getRootException()
Returns the root exception of this exception.- Returns:
- the root exception of this exception
-
printStackTrace
public void printStackTrace()
Prints thisWrappedExceptionand its backtrace to the standard error stream.- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
Prints thisWrappedExceptionand its backtrace to the specified print stream.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
public void printStackTrace(PrintWriter s)
Prints thisWrappedExceptionand its backtrace to the specified print writer.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintWriterto use for output- Since:
- JDK1.1
-
-