Class ExceptionUtils

java.lang.Object
ch.systemsx.cisd.common.exceptions.ExceptionUtils

public final class ExceptionUtils extends Object
Provides utilities for manipulating and examining Throwable objects.
  • 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 or java.lang, ch.systemsx.cisd.common.
    • tryGetThrowableOfClass

      public static final <T extends Throwable> T tryGetThrowableOfClass(Throwable throwable, Class<T> clazz)
      Returns the first found Throwable of given clazz from the exception chain of given throwable.
    • getEndOfChain

      public static Throwable getEndOfChain(Throwable throwable)
      Returns the last Throwable of a chain of throwables.