/** * Apply this function and run the given action in case of exception. * * @param action Action to run when exception occurs. * @return A new function. */ default Function2<V1, V2, R> onFailure(java.util.function.Consumer<Throwable> action) { return onFailure(Throwable.class, action); }