public static < T > Future < T > ofError ( final Throwable error ) { final CompletableFuture < T > cf = new CompletableFuture <> ( ) ; cf . completeExceptionally ( error ) ; return Future . < T > of ( cf ) ; }
Construct a completed - with - error Future from the given Exception