onErrorResumeNext method

Observable<T> onErrorResumeNext (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.

Example

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

Implementation

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