Class TigerExceptionUtils
java.lang.Object
de.gematik.test.tiger.proxy.handler.TigerExceptionUtils
-
Method Summary
Modifier and TypeMethodDescriptiongetCauseWithMessageMatching(Throwable exception, Predicate<String> messageMatcher) Looks if a cause with matching message is foundgetCauseWithType(Throwable exception, Class<E> causeClassToDetect) Looks for a cause with the given type and returns it if present.static StringgetStackTraceAsString(Throwable throwable)
-
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 inspectedcauseClassToDetect- 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 inspectedmessageMatcher- The matcher for the exception-message
-
getStackTraceAsString
-