Package org.alfresco.error
Class ExceptionStackUtil
- java.lang.Object
-
- org.alfresco.error.ExceptionStackUtil
-
public class ExceptionStackUtil extends Object
Helper class to provide information about exception stacks.- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description ExceptionStackUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Throwable
getCause(Throwable throwable, Class<?>... possibleCauses)
Searches through the exception stack of the given throwable to find any instance of the possible cause.
-
-
-
Method Detail
-
getCause
public static Throwable getCause(Throwable throwable, Class<?>... possibleCauses)
Searches through the exception stack of the given throwable to find any instance of the possible cause. The top-level throwable will also be tested.- Parameters:
throwable
- the exception condition to searchpossibleCauses
- the types of the exception conditions of interest- Returns:
- Returns the first instance that matches one of the given possible types, or null if there is nothing in the stack
-
-