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 ThrowableType
getThrowableType(Throwable cause)
Classify the exceptions by extracting theThrowableType
from a potentialThrowableAnnotation
.
-
-
-
Method Detail
-
getThrowableType
public static ThrowableType getThrowableType(Throwable cause)
Classify the exceptions by extracting theThrowableType
from a potentialThrowableAnnotation
.- Parameters:
cause
- theThrowable
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
-
-