Error Handling
Introduction
Section titled “Introduction”RxJS provides operators for graceful error recovery without terminating the stream.
Operators
Section titled “Operators”// catchError — recover from errorshttp.get('/api/data').pipe( catchError(err => { console.error(err); return of([]); // Return fallback }))
// retry — retry failed requestshttp.get('/api/data').pipe( retry({ count: 3, delay: (_, n) => timer(Math.pow(2, n) * 1000) }))Summary
Section titled “Summary”Proper error handling ensures streams remain resilient in production.”