@Test public void immediateFailed() throws Exception { doReturn(from).when(failedFn).apply(cause); assertThat(base.thenApplyCaughtFailed(failedFn, cause), is(new ImmediateCompleted<>(caller, from))); }
Stage<T> thenApplyCaughtFailed( final Function<? super Throwable, ? extends T> fn, final Throwable cause ) { final T value; try { value = fn.apply(cause); } catch (final Exception e) { return executionExceptionFailed(e, cause); } return new ImmediateCompleted<>(caller, value); }
AbstractImmediate implements Stage<T> { Stage<T> thenApplyCaughtFailed( final Function<? super Throwable, ? extends T> fn, final Throwable cause ) { final T value; try { value = fn.apply(cause); } catch (final Exception e) { return executionExceptionFailed(e, cause); } return new ImmediateCompleted<>(caller, value); } }
AbstractImmediate implements Stage<T> { Stage<T> thenApplyCaughtFailed( final Function<? super Throwable, ? extends T> fn, final Throwable cause ) { final T value; try { value = fn.apply(cause); } catch (final Exception e) { return executionExceptionFailed(e, cause); } return new ImmediateCompleted<>(caller, value); }  }
AbstractImmediate implements Stage<T> { Stage<T> thenApplyCaughtFailed( final Function<? super Throwable, ? extends T> fn, final Throwable cause ) { final T value; try { value = fn.apply(cause); } catch (final Exception e) { return executionExceptionFailed(e, cause); } return new ImmediateCompleted<>(caller, value); }   }
AbstractImmediate implements Stage<T> { Stage<T> thenApplyCaughtFailed( final Function<? super Throwable, ? extends T> fn, final Throwable cause ) { final T value; try { value = fn.apply(cause); } catch (final Exception e) { return executionExceptionFailed(e, cause); } return new ImmediateCompleted<>(caller, value); }    }