public class UncheckedException
extends java.lang.RuntimeException
| Modifier and Type | Class and Description |
|---|---|
static interface |
UncheckedException.CallableVoid |
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Throwable |
cause |
protected static java.lang.String |
CAUSE_DIV
Divider between causes printouts.
|
protected boolean |
showCauseDetails
If set to
true stack trace will be enhanced with cause's stack traces. |
| Constructor and Description |
|---|
UncheckedException() |
UncheckedException(java.lang.String message) |
UncheckedException(java.lang.String message,
java.lang.Throwable t) |
UncheckedException(java.lang.String message,
java.lang.Throwable t,
boolean showCauseDetails) |
UncheckedException(java.lang.Throwable t) |
UncheckedException(java.lang.Throwable t,
boolean showCauseDetails) |
| Modifier and Type | Method and Description |
|---|---|
static <V> V |
callAndWrapException(java.util.concurrent.Callable<V> callable)
Wraps checked exceptions in a
UncheckedException. |
java.lang.Throwable |
getCause()
Returns exception cause.
|
java.lang.String |
getMessage()
Returns the detail message, including the message from the nested exception if there is one.
|
void |
printStackTrace() |
void |
printStackTrace(java.io.PrintStream ps) |
void |
printStackTrace(java.io.PrintWriter pw) |
void |
rethrow()
Re-throws cause if exists.
|
static void |
runAndWrapException(UncheckedException.CallableVoid callable)
Wraps checked exceptions in a
UncheckedException. |
static java.lang.RuntimeException |
wrap(java.lang.Throwable t)
Wraps all exceptions in a
UncheckedException |
static java.lang.RuntimeException |
wrap(java.lang.Throwable t,
java.lang.String message)
Wraps all exceptions in a
UncheckedException |
protected final java.lang.Throwable cause
protected static final java.lang.String CAUSE_DIV
protected final boolean showCauseDetails
true stack trace will be enhanced with cause's stack traces.public UncheckedException(java.lang.Throwable t)
public UncheckedException(java.lang.Throwable t,
boolean showCauseDetails)
public UncheckedException()
public UncheckedException(java.lang.String message)
public UncheckedException(java.lang.String message,
java.lang.Throwable t)
public UncheckedException(java.lang.String message,
java.lang.Throwable t,
boolean showCauseDetails)
public void printStackTrace()
printStackTrace in class java.lang.Throwablepublic void printStackTrace(java.io.PrintStream ps)
printStackTrace in class java.lang.Throwablepublic void printStackTrace(java.io.PrintWriter pw)
printStackTrace in class java.lang.Throwablepublic java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic static <V> V callAndWrapException(java.util.concurrent.Callable<V> callable)
UncheckedException.
Unchecked exceptions are not wrapped.public static void runAndWrapException(UncheckedException.CallableVoid callable)
UncheckedException.
Unchecked exceptions are not wrapped.public static java.lang.RuntimeException wrap(java.lang.Throwable t)
UncheckedExceptionpublic static java.lang.RuntimeException wrap(java.lang.Throwable t,
java.lang.String message)
UncheckedExceptionpublic void rethrow()
throws java.lang.Throwable
java.lang.Throwablepublic java.lang.Throwable getCause()
getCause in class java.lang.ThrowableCopyright © 2003-present Jodd Team