catch / catchError
signature: catchError(project: (err: any, caught: Observable<T>) => ObservableInput<any>): Observable
catchError(project: (err: any, caught: Observable<T>) => ObservableInput<any>): ObservableGracefully handle errors in an observable sequence.
Why use catchError?
Examples
Example 1: Catching error from observable
Example 2: Catching rejected promise
Example 3: Catching errors comparison when using switchMap/mergeMap/concatMap/exhaustMap
Example 4: Providing fallback data on HTTP error
Related Recipes
Additional Resources
Last updated