Package com.day.util
Class WrappedRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.day.util.WrappedRuntimeException
-
- All Implemented Interfaces:
Serializable
public abstract class WrappedRuntimeException extends RuntimeException
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 WrappedRuntimeException(Exception e)
Class constructor that creates aWrappedException
given a root exceptionWrappedRuntimeException(String s)
Class constructor that creates aWrappedException
given a message describing the failure causeWrappedRuntimeException(String s, Throwable e)
Class constructor that creates aWrappedException
given a message describing the failure cause and a root exception
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMessage()
Returns the error message string of this exception.Throwable
getRootException()
Returns the root exception of this exception.void
printStackTrace()
Prints thisWrappedException
and its backtrace to the standard error stream.void
printStackTrace(PrintStream s)
Prints thisWrappedException
and its backtrace to the specified print stream.void
printStackTrace(PrintWriter s)
Prints thisWrappedException
and 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
-
WrappedRuntimeException
public WrappedRuntimeException(String s)
Class constructor that creates aWrappedException
given a message describing the failure cause- Parameters:
s
- description
-
WrappedRuntimeException
public WrappedRuntimeException(String s, Throwable e)
Class constructor that creates aWrappedException
given a message describing the failure cause and a root exception- Parameters:
s
- descriptione
- root failure cause
-
WrappedRuntimeException
public WrappedRuntimeException(Exception e)
Class constructor that creates aWrappedException
given a root exception- Parameters:
e
- root failure cause
-
-
Method Detail
-
getMessage
public String getMessage()
Returns the error message string of this exception.- Overrides:
getMessage
in 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 thisWrappedException
and its backtrace to the standard error stream.- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
Prints thisWrappedException
and its backtrace to the specified print stream.- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-PrintStream
to use for output
-
printStackTrace
public void printStackTrace(PrintWriter s)
Prints thisWrappedException
and its backtrace to the specified print writer.- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-PrintWriter
to use for output
-
-