Sequence onError Handler
Explore how to handle errors in RxJS Observables using the onError handler. Understand why try/catch is insufficient for asynchronous code and learn to catch errors within sequences to build more robust reactive programs.
We'll cover the following...
We'll cover the following...
Handling errors
We can’t use the conventional try/catch mechanism in callbacks, because it is synchronous. It would run before any asynchronous code, and wouldn’t be able to catch any errors.
With callbacks, this was solved by passing the error (if any) as a parameter to the callback function. This works, but makes the code ...