Tuesday, November 26, 2019

react to an error and then turn around and return a placebo Observable with of

This has this example of using catchError in a pipe to react to the error and then turn around and return a placebo, emptyish Observable with of so that there is not literally an error thrown.

catchError(() => { console.error('Error emitted'); return of([]); })

 
 

I cannot get this to work in the Angular 5 application I am working on. The version of RXJS is probably a bit too early for this.

No comments:

Post a Comment