public final class ExceptionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
chainContains(Throwable exception,
Class<? extends Throwable> exceptionType)
Determine whether a particular exception type occurs on the chain of causes of an exception.
|
static <T extends Throwable> |
getFromChainOfType(Throwable exception,
Class<T> exceptionType)
Get the first exception that has a particular type fromt he chain of causes of an exception.
|
static Throwable |
getUltimateCause(Throwable t)
Get the ultimate root cause of an exception.
|
public static Throwable getUltimateCause(Throwable t)
t - The exception of which to obtain the ultimate root cause.public static boolean chainContains(Throwable exception, Class<? extends Throwable> exceptionType)
exception - The exception of which to inspect the chain of causes.exceptionType - The type of exception for which to look.true if the chain of causes of the specified exception contains an exception that has the
specified type.public static <T extends Throwable> T getFromChainOfType(Throwable exception, Class<T> exceptionType)
T - The type of exception for which to look.exception - The exception of which to inspect the chain of causes.exceptionType - The type of exception for which to look.null if there is no such exception.Copyright © 2011–2025 pepsoft.org. All rights reserved.