Class ThrowableClassifier
java.lang.Object
org.apache.flink.runtime.throwable.ThrowableClassifier
Helper class, given a exception do the classification.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindThrowableOfThrowableType(Throwable throwable, ThrowableType throwableType) Checks whether a throwable chain contains a specific throwable type and returns the corresponding throwable.static ThrowableTypegetThrowableType(Throwable cause) Classify the exceptions by extracting theThrowableTypefrom a potentialThrowableAnnotation.
-
Constructor Details
-
ThrowableClassifier
public ThrowableClassifier()
-
-
Method Details
-
getThrowableType
Classify the exceptions by extracting theThrowableTypefrom a potentialThrowableAnnotation.- Parameters:
cause- theThrowableto classify.- Returns:
- The extracted
ThrowableTypeor 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
-