You need to apply a restriction to the retry signal, for example, if you want only 10 retries:
loadSomething(): Observable<SomeInterface> { return this.http.get(this.someEndpoint, commonHttpHeaders()) .retryWhen(errors =>
EDIT
Some commentators have asked how to make sure that the last error is thrown. The answer is a little less clear, but no less effective, just use one of the smoothing map operators (concatMap, mergeMap, switchMap) to check which index you belong to.
Note. Using the new RxJS 6 pipe syntax for further validation (this is also available in later versions of RxJS 5).
loadSomething(): Observable<SomeInterface> { const retryPipeline =
paulpdaniels
source share