public class NestedRuntimeException extends RuntimeException
RuntimeException which is nested to preserve stack traces.
This class allows the following code to be written to convert a regular
Exception into a RuntimeException without losing the stack trace.
try {
...
} catch (Exception e) {
throw new RuntimeException(e);
}
| Constructor and Description |
|---|
NestedRuntimeException(String msg,
Throwable cause)
Constructs a new
NestedRuntimeException with specified
detail message and nested Throwable. |
NestedRuntimeException(Throwable cause)
Constructs a new
NestedRuntimeException with specified
nested Throwable. |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getCause() |
void |
printStackTrace() |
void |
printStackTrace(PrintStream out) |
void |
printStackTrace(PrintWriter out) |
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toStringpublic NestedRuntimeException(Throwable cause)
NestedRuntimeException with specified
nested Throwable.cause - the exception or error that caused this exception to be
thrownpublic void printStackTrace()
printStackTrace in class Throwablepublic void printStackTrace(PrintStream out)
printStackTrace in class Throwablepublic void printStackTrace(PrintWriter out)
printStackTrace in class ThrowableCopyright © 2012 Apache Software Foundation. All Rights Reserved.