Class ThrowableClassifier

java.lang.Object
org.apache.flink.runtime.throwable.ThrowableClassifier

public class ThrowableClassifier extends Object
Helper class, given a exception do the classification.
  • Constructor Details

    • ThrowableClassifier

      public ThrowableClassifier()
  • Method Details

    • getThrowableType

      public static ThrowableType getThrowableType(Throwable cause)
      Classify the exceptions by extracting the ThrowableType from a potential ThrowableAnnotation.
      Parameters:
      cause - the Throwable to classify.
      Returns:
      The extracted ThrowableType or ThrowableType.RecoverableError if there is no such annotation.
    • findThrowableOfThrowableType

      public static Optional<Throwable> findThrowableOfThrowableType(Throwable throwable, ThrowableType throwableType)
      Checks whether a throwable chain contains a specific throwable type and returns the corresponding throwable.
      Parameters:
      throwable - the throwable chain to check.
      throwableType - the throwable type to search for in the chain.
      Returns:
      Optional throwable of the throwable type if available, otherwise empty