@Test public void emptySource() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.<Integer>empty() .onErrorResumeWith(e -> Single.just(e.hashCode())) .subscribe(ts); ts.assertResult(); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeWithSubscriber<>(subscriber, fallbackFunction)); }
SingleOnErrorResumeWith extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeWithSubscriber<>(subscriber, fallbackFunction)); } }
SingleOnErrorResumeWith extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeWithSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResumeWith(Single<T> source,
                            Function<? super Throwable, ? extends Single<? extends T>> fallbackFunction); }
SingleOnErrorResumeWith extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeWithSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResumeWith(Single<T> source,
                            Function<? super Throwable, ? extends Single<? extends T>> fallbackFunction); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
SingleOnErrorResumeWith extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeWithSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResumeWith(Single<T> source,
                            Function<? super Throwable, ? extends Single<? extends T>> fallbackFunction); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }