@Test public void fallbackFunctionCrash() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.<Integer>error(new IOException()) .onErrorResume(e -> { throw new IllegalArgumentException(); }) .subscribe(ts); ts.assertFailure(IllegalArgumentException.class); assertThat(ts.getLastError().getSuppressed()[0], instanceOf(IOException.class)); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); }
SingleOnErrorResume extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); } }
SingleOnErrorResume extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResume(Single<T> source,
                        Function<? super Throwable, ? extends T> fallbackFunction); }
SingleOnErrorResume extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResume(Single<T> source,
                        Function<? super Throwable, ? extends T> fallbackFunction); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
SingleOnErrorResume extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResume(Single<T> source,
                        Function<? super Throwable, ? extends T> fallbackFunction); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }