When Good AJAX Goes Bad

Let's see how to gracefully handle errors when good AJAX goes bad.

We'll cover the following

Errors

If you’ve been lucky, you haven’t hit any errors so far. Time to change that.

I’ve prepared a slightly different observable for you in errors.ts.

Loading bar application

This new observable still has all the requests, but they hit a different endpoint on the node server. This new endpoint is programmed to give up and start spitting errors after several dozen requests.

Using your knowledge from earlier in the chapter, we are passing in a function to handle the case where some requests fail to complete.

Get hands-on with 1200+ tech skills courses.