public class WrappedException
extends java.lang.RuntimeException
Constructor and Description |
---|
WrappedException()
Create a new WrappedException.
|
WrappedException(java.lang.String message)
Create a new WrappedException.
|
WrappedException(java.lang.String message,
java.lang.Throwable e)
Create a new WrappedException from an existing exception.
|
WrappedException(java.lang.Throwable e)
Create a new WrappedException wrapping an existing exception.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getException()
Return the embedded exception, if any.
|
static void |
rethrow(java.lang.Throwable ex) |
java.lang.String |
toString()
Convert this exception to a string.
|
static java.lang.RuntimeException |
wrapIfNeeded(java.lang.Throwable ex)
Coerce argument to a RuntimeException.
|
public WrappedException()
public WrappedException(java.lang.String message)
message
- The error or warning message.public WrappedException(java.lang.Throwable e)
The existing exception will be embedded in the new one, and its message will become the default message for the WrappedException.
e
- The exception to be wrapped in a WrappedException.public WrappedException(java.lang.String message, java.lang.Throwable e)
The existing exception will be embedded in the new one, but the new exception will have its own message.
message
- The detail message.e
- The exception to be wrapped in a WrappedException.public java.lang.Throwable getException()
public java.lang.String toString()
toString
in class java.lang.Throwable
public static java.lang.RuntimeException wrapIfNeeded(java.lang.Throwable ex)
public static void rethrow(java.lang.Throwable ex)