public abstract class NestedExceptionUtils extends Object
Mainly for use within the framework.
NestedRuntimeException
,
NestedCheckedException
,
NestedIOException
,
NestedServletException
Constructor and Description |
---|
NestedExceptionUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
buildMessage(String message,
Throwable cause)
Build a message for the given base message and root cause.
|
static Throwable |
getMostSpecificCause(Throwable original)
Retrieve the most specific cause of the given exception, that is,
either the innermost cause (root cause) or the exception itself.
|
static Throwable |
getRootCause(Throwable original)
Retrieve the innermost cause of the given exception, if any.
|
public static String buildMessage(String message, Throwable cause)
message
- the base messagecause
- the root causepublic static Throwable getRootCause(Throwable original)
original
- the original exception to introspectnull
if nonepublic static Throwable getMostSpecificCause(Throwable original)
Differs from getRootCause(java.lang.Throwable)
in that it falls back
to the original exception if there is no root cause.
original
- the original exception to introspectnull
)