Class ExceptionUtils
- java.lang.Object
-
- ch.systemsx.cisd.common.exceptions.ExceptionUtils
-
public final class ExceptionUtils extends java.lang.Object
Provides utilities for manipulating and examiningThrowable
objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Exception
createMasqueradingExceptionIfNeeded(java.lang.Exception exception, java.util.Collection<java.lang.String> acceptedPackages)
Analyzes given exception and makes it independent to packages outside the specified collection orjava.lang, ch.systemsx.cisd.common
.static java.lang.Throwable
getEndOfChain(java.lang.Throwable throwable)
Returns the lastThrowable
of a chain of throwables.static <T extends java.lang.Throwable>
TtryGetThrowableOfClass(java.lang.Throwable throwable, java.lang.Class<T> clazz)
Returns the first foundThrowable
of given clazz from the exception chain of given throwable.
-
-
-
Method Detail
-
createMasqueradingExceptionIfNeeded
public static final java.lang.Exception createMasqueradingExceptionIfNeeded(java.lang.Exception exception, java.util.Collection<java.lang.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 java.lang.Throwable> T tryGetThrowableOfClass(java.lang.Throwable throwable, java.lang.Class<T> clazz)
Returns the first foundThrowable
of given clazz from the exception chain of given throwable.
-
getEndOfChain
public static java.lang.Throwable getEndOfChain(java.lang.Throwable throwable)
Returns the lastThrowable
of a chain of throwables.
-
-