public class ExceptionUtils extends java.lang.Object
Constructor and Description |
---|
ExceptionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends java.lang.Throwable> |
findCause(java.lang.Throwable t,
java.lang.Class<T> type)
Locates a particular type of exception, working its way via the cause property of each exception in the exception
stack.
|
static <T extends java.lang.Throwable> |
findCause(java.lang.Throwable t,
java.lang.Class<T> type,
PropertyAccess access)
Locates a particular type of exception, working its way down via any property that returns some type of Exception.
|
static java.lang.String |
toMessage(java.lang.Throwable exception)
Extracts the message from an exception.
|
public ExceptionUtils()
public static <T extends java.lang.Throwable> T findCause(java.lang.Throwable t, java.lang.Class<T> type)
t
- the outermost exceptiontype
- the type of exception to search forpublic static <T extends java.lang.Throwable> T findCause(java.lang.Throwable t, java.lang.Class<T> type, PropertyAccess access)
findCause(Throwable, Class)
as it works with older exceptions
that do not properly implement the (relatively new) cause property.t
- the outermost exceptiontype
- the type of exception to search foraccess
- used to access propertiespublic static java.lang.String toMessage(java.lang.Throwable exception)
exception
- to extract message from${project.version} - Copyright © 2003-2015 The Apache Software Foundation.