Class ExceptionUtils
java.lang.Object
ch.systemsx.cisd.common.exceptions.ExceptionUtils
Provides utilities for manipulating and examining
Throwable objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic final ExceptioncreateMasqueradingExceptionIfNeeded(Exception exception, Collection<String> acceptedPackages) Analyzes given exception and makes it independent to packages outside the specified collection orjava.lang, ch.systemsx.cisd.common.static ThrowablegetEndOfChain(Throwable throwable) Returns the lastThrowableof a chain of throwables.static final <T extends Throwable>
TtryGetThrowableOfClass(Throwable throwable, Class<T> clazz) Returns the first foundThrowableof given clazz from the exception chain of given throwable.
-
Method Details
-
createMasqueradingExceptionIfNeeded
public static final Exception createMasqueradingExceptionIfNeeded(Exception exception, Collection<String> acceptedPackages) Analyzes given exception and makes it independent to packages outside the specified collection orjava.lang, ch.systemsx.cisd.common. -
tryGetThrowableOfClass
public static final <T extends Throwable> T tryGetThrowableOfClass(Throwable throwable, Class<T> clazz) Returns the first foundThrowableof given clazz from the exception chain of given throwable. -
getEndOfChain
Returns the lastThrowableof a chain of throwables.
-