O'Reilly logo

Mastering Reactive JavaScript by Erich de Souza Oliveira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The onErrorResumeNext() operator

The operator onErrorResumeNext() runs a list of observables from left to right, passing to the next observable either when the current observable finishes, or when an error occurs. This method is available in the Observable class and has the following signature:

Rx.Observable.onErrorResumeNext(observables); 

As you can see it receives an arbitrary number of arguments:

  • observables: It is an arbitrary number of observables to be executed from left to right; the next observable starts when the current finishes or fails.

We can use some of the examples from the previous section, changing only the operator to illustrate how the onErrorResumeNext() operator works:

Rx.Observable.onErrorResumeNext(  Rx.Observable.throw(new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required