public class ThrowableClassifier extends Object
Constructor and Description |
---|
ThrowableClassifier() |
Modifier and Type | Method and 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 the
ThrowableType from a potential ThrowableAnnotation . |
public static ThrowableType getThrowableType(Throwable cause)
ThrowableType
from a potential ThrowableAnnotation
.cause
- the Throwable
to classify.ThrowableType
or ThrowableType.RecoverableError if there is no
such annotation.public static Optional<Throwable> findThrowableOfThrowableType(Throwable throwable, ThrowableType throwableType)
throwable
- the throwable chain to check.throwableType
- the throwable type to search for in the chain.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.