public static < T > CompletableFuture < T > failedFuture ( Throwable exception ) { CompletableFuture < T > result = new CompletableFuture <> ( ) ; result . completeExceptionally ( exception ) ; return result ; }
Creates a new CompletableFuture that is failed with the given exception .