Resubscribe to an Observable on Error with RxJS retry

InstructorAndré Staltz

Share this video with your friends

Send Tweet

Besides catch, the other commonly used error handling operator is retry(). This lessons teaches how retry() and retryWhen() detect errors and how they re-subscribe to the source, besides highlighting its real-world applications.

🚨 Since we are importing interval from RxJS, we don't need to preface our Observables with Rx.Observable. You can no longer .{operator}, you need to .pipe({operator}) instead. To link together multiple Observables and Operators, the method is a bit different. You call zip first, then list your Observables, your functions, then pipe your Operators.

Thomas
~ 7 years ago

What does it mean to try again? Resubscribe to the source observable?

Viktor Soroka
~ 7 years ago

Yep, to subscribe again which André basically said during the lecture.