public static < V > CompletionStage < Try < V > > tryStage ( CompletionStage < V > completionStage ) { return completionStage . handle ( ( value , throwable ) -> { if ( throwable != null ) { return failed ( throwable ) ; } return succeeded ( value ) ; } ) ; }
Creates a CompletionStage that when it completes will capture into a Try whether the given completionStage was successful or not