Class TigerExceptionUtils

java.lang.Object
de.gematik.test.tiger.proxy.handler.TigerExceptionUtils

public class TigerExceptionUtils extends Object
  • Method Details

    • getCauseWithType

      public static <E extends Throwable> Optional<E> getCauseWithType(Throwable exception, Class<E> causeClassToDetect)
      Looks for a cause with the given type and returns it if present. If not then an empty Optional is returned.
      Type Parameters:
      E - Type of the cause class
      Parameters:
      exception - The exception to be inspected
      causeClassToDetect - The cause-class to detect
    • getCauseWithMessageMatching

      public static Optional<Throwable> getCauseWithMessageMatching(Throwable exception, Predicate<String> messageMatcher)
      Looks if a cause with matching message is found
      Parameters:
      exception - The exception to be inspected
      messageMatcher - The matcher for the exception-message
    • getStackTraceAsString

      public static String getStackTraceAsString(Throwable throwable)