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 Summary
Constructors Constructor Description ThrowableClassifier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<Throwable>findThrowableOfThrowableType(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.
-
-
-
Method Detail
-
getThrowableType
public static ThrowableType getThrowableType(Throwable cause)
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
-
-