CompletableFuture recoverWith equivalent? i.e. exceptionally but return CompletableFuture
Is this what you are looking for? askPong(“cause error”) .handle( (pong, ex) -> ex == null ? CompletableFuture.completedFuture(pong) : askPong(“Ping”) ).thenCompose(x -> x); Also, do not use the …Async methods unless you intend for the body of the supplied function to be executed asynchronously. So when you do something like .handleAsync((x, t) -> { if … Read more