tyrex.util
public abstract class NestedException extends Exception
This exception can optionally wrap another exception. The printed stack trace
will be that of the wrapped exception, if one is provided in the constructor.
The underlying exception can be obtained from getException
.
Several exceptions support wrapping of an underlying exception by extending from this class. When another nested exception is provided in the constructor, the underlying exception will be used, so it's safe to construct a nested exception from another nested exception.
Support for unwrapping the underlying exceptions include NestedException, org.xml.sax.SAXException.
Version: $Revision: 1.2 $
Constructor Summary | |
---|---|
NestedException(String message, Exception except)
Construct a new nested exception wrapping an underlying exception
and providing a message.
| |
NestedException(String message)
Construct a new nested with a message.
| |
NestedException(Exception except)
Construct a new nested exception wrapping an underlying exception.
|
Method Summary | |
---|---|
Exception | getException()
Returns the underlying exception, if this exception wraps another exception.
|
void | printStackTrace() |
void | printStackTrace(PrintStream stream) |
void | printStackTrace(PrintWriter writer) |
Parameters: message The exception message except The underlying exception
Parameters: message The exception message
Parameters: except The underlying exception
Returns: The underlying exception, or null