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 java.lang.RuntimeException |
rethrow(java.lang.Throwable ex)
Re-throw as a non-checked exception.
|
java.lang.String |
toString()
Convert this exception to a string.
|
static java.lang.RuntimeException |
wrapIfNeeded(java.lang.Exception 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.Exception ex)
public static java.lang.RuntimeException rethrow(java.lang.Throwable ex)
throw WrappedExcepton.rethrow(ex)
so javac and the verifier can know the code doesn't return.