public static < T > void exceptionListener ( CompletableFuture < T > completableFuture , Consumer < Throwable > exceptionListener ) { completableFuture . whenComplete ( ( r , ex ) -> { if ( ex != null ) { Callbacks . invokeSafely ( exceptionListener , ex , null ) ; } } ) ; }
Registers an exception listener to the given CompletableFuture .