ExceptionRecognizerAbstract

Abstract implementation of ExceptionRecognizer that looks exceptions meeting the Predicate supplied in the constructor and, if found anywhere in the causal chain, then returns a non-null message indicating that the exception has been recognized.

If a messaging-parsing Function is provided through the constructor, then the message can be altered. Otherwise the exception’s Throwable#getMessage() message is returned as-is.

API

ExceptionRecognizerAbstract.java
class ExceptionRecognizerAbstract {
  ExceptionRecognizerAbstract(Category category, Predicate<Throwable> predicate, Function<Throwable, String> rootCauseMessageFormatter)
  ExceptionRecognizerAbstract(Predicate<Throwable> predicate, Function<Throwable, String> rootCauseMessageFormatter)
  ExceptionRecognizerAbstract(Category category, Predicate<Throwable> predicate)
  ExceptionRecognizerAbstract(Predicate<Throwable> predicate)
  Optional<Recognition> recognize(Throwable ex)
}