public final class Exceptions
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T extends java.lang.Throwable> |
is(java.lang.Throwable exception,
java.lang.Class<T> type)
Returns
true if the given exception or one of its nested causes is an instance of the given type. |
static <T extends java.lang.Throwable> |
unwrap(java.lang.Throwable exception,
java.lang.Class<T> type)
Unwrap the nested causes of given exception as long as until it is not an instance of the given type and then
return it.
|
public static <T extends java.lang.Throwable> java.lang.Throwable unwrap(java.lang.Throwable exception, java.lang.Class<T> type)
ServletException
or FacesException
.exception
- The exception to be unwrapped.type
- The type which needs to be unwrapped.public static <T extends java.lang.Throwable> boolean is(java.lang.Throwable exception, java.lang.Class<T> type)
true
if the given exception or one of its nested causes is an instance of the given type.exception
- The exception to be checked.type
- The type to be compared to.true
if the given exception or one of its nested causes is an instance of the given type.