public static < T > Callable < T > recover ( Callable < T > callable , Function < Exception , T > exceptionHandler ) { return ( ) -> { try { return callable . call ( ) ; } catch ( Exception exception ) { return exceptionHandler . apply ( exception ) ; } } ; }
Returns a composed function that first executes the Callable and optionally recovers from an exception .