org.apache.tapestry5.ioc.util
Class ExceptionUtils
java.lang.Object
org.apache.tapestry5.ioc.util.ExceptionUtils
public class ExceptionUtils
- extends Object
Contains static methods useful for manipulating exceptions.
Method Summary |
static
|
findCause(Throwable t,
Class<T> type)
Locates a particular type of exception, working its way via the cause property of each exception in the exception
stack. |
static
|
findCause(Throwable t,
Class<T> type,
PropertyAccess access)
Locates a particular type of exception, working its way down via any property that returns some type of Exception. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExceptionUtils
public ExceptionUtils()
findCause
public static <T extends Throwable> T findCause(Throwable t,
Class<T> type)
- Locates a particular type of exception, working its way via the cause property of each exception in the exception
stack.
- Parameters:
t
- the outermost exceptiontype
- the type of exception to search for
- Returns:
- the first exception of the given type, if found, or null
findCause
public static <T extends Throwable> T findCause(Throwable t,
Class<T> type,
PropertyAccess access)
- Locates a particular type of exception, working its way down via any property that returns some type of Exception.
This is more expensive, but more accurate, than
findCause(Throwable, Class)
as it works with older exceptions
that do not properly implement the (relatively new) cause property.
- Parameters:
t
- the outermost exceptiontype
- the type of exception to search foraccess
- used to access properties
- Returns:
- the first exception of the given type, if found, or null
Copyright © 2003-2012 The Apache Software Foundation.