onErrorResumeNext method

Observable<T> onErrorResumeNext(
  1. Stream<T> recoveryStream

Intercepts error events and switches to the given recovery stream in that case

The onErrorResumeNext operator intercepts an onError notification from the source Observable. Instead of passing the error through to any listeners, it replaces it with another Stream of items.

If you need to perform logic based on the type of error that was emitted, please consider using onErrorResume.


new Observable.error(new Exception())
  .onErrorResumeNext(new Observable.fromIterable([1, 2, 3]))
  .listen(print); // prints 1, 2, 3


Observable<T> onErrorResumeNext(Stream<T> recoveryStream) => transform(
    OnErrorResumeStreamTransformer<T>((dynamic e) => recoveryStream));