Package org.apache.druid.utils
Class Throwables
- java.lang.Object
-
- org.apache.druid.utils.Throwables
-
public final class Throwables extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Throwable>
TgetCauseOfType(Throwable t, Class<T> searchFor)
searches for a throwable in the cause chain that is of same type as {@param searchFor}.
-
-
-
Method Detail
-
getCauseOfType
@Nullable public static <T extends Throwable> T getCauseOfType(Throwable t, Class<T> searchFor)
searches for a throwable in the cause chain that is of same type as {@param searchFor}. The class of returned throwable will either be same as {@param searchFor} or a sub-class of {@param searchFor}.- Parameters:
t
- - the throwable in which to searchsearchFor
- - Class of throwable to search for- Returns:
- null if not found otherwise the cause exception that is of same type as searchFor
-
-