Using the Error-Handling Object

Error handling is essential to a successful web application, but it is often overlooked and deemed a boring chore to developers. Using the Observer pattern for Ajax error handling allows us to create an extremely intuitive user experience and is actually quite interesting to program. As you learned in Chapter 9, “Extending the Engine,” with HTTP status codes, we can also provide immediate feedback and options to the user when errors occur without disrupting the flow of experience or leaving a user with questions regarding what to do next. Imagine having an object that can control all the alerts in your application. I have created one that is named Alert. This object registers an error method with the ErrorManager ...

Get Ajax for Web Application Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.