/** * Execute the given action before throwing the exception. * * @param action Action to execute. * @param <TV1> Input type. * @param <TV2> Input type. * @return A new consumer with a listener action. */ default <TV1 extends V1, TV2 extends V2> Consumer2<TV1, TV2> onFailure( java.util.function.Consumer<Throwable> action) { return onFailure(Throwable.class, action); }