@Test public void mapperCrash() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.just(1) .<Integer>flatMapSingle(v -> { throw new IllegalArgumentException(); }) .subscribe(ts); ts.request1(); assertThat(ts.getItems().isEmpty(), is(true)); assertThat(ts.getLastError(), instanceOf(IllegalArgumentException.class)); assertThat(ts.isComplete(), is(false)); }
@Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); }
SingleFlatMapSingle extends CompletionSingle<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } }
SingleFlatMapSingle extends CompletionSingle<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapSingle(Single<T> source, Function<? super T, ? extends Single<? extends R>> mapper); }
SingleFlatMapSingle extends CompletionSingle<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapSingle(Single<T> source, Function<? super T, ? extends Single<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber); }
SingleFlatMapSingle extends CompletionSingle<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapSingle(Single<T> source, Function<? super T, ? extends Single<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber);  }