public interface FaultClassifier
| Modifier and Type | Method and Description |
|---|---|
Throwable |
classify(Throwable throwable)
Classifies the given
throwable into transient and persistent faults. |
default <T> T |
classifyExceptionally(Throwable throwable)
Provides a function that classifies its argument using
classify(Throwable) and throws it. |
static FaultClassifier |
create(Collection<Predicate<Throwable>> predicates) |
static FaultClassifier |
create(Predicate<Throwable>... predicates) |
static FaultClassifier |
createDefault() |
static List<Predicate<Throwable>> |
defaults() |
Throwable classify(Throwable throwable)
throwable into transient and persistent faults.throwable - the throwableTransientFaultException with the given
throwable as its cause, if it's considered transientdefault <T> T classifyExceptionally(Throwable throwable) throws Throwable
classify(Throwable) and throws it. This function
is supposed to be used in conjunction with CompletableFuture.exceptionally(Function).T - generic return typethrowable - the throwableThrowableCompletableFuture.exceptionally(Function)static FaultClassifier createDefault()
@SafeVarargs static FaultClassifier create(Predicate<Throwable>... predicates)
static FaultClassifier create(Collection<Predicate<Throwable>> predicates)
Copyright © 2015–2018 Zalando SE. All rights reserved.