O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling Store exceptions

Unfortunately we cannot guarantee that the server will process our stores' requests correctly 100 percent of the time. When the server returns an error or fails to respond, it's useful to be ready to inform our users that something has not worked as expected and perhaps perform extra processing or tidying up. This recipe demonstrates how to handle proxy exceptions and present an error message to the user.

Getting ready

To demonstrate exception handling you will need to ensure that you have a running web server to host the example and serve the provided error-response.json file.

How to do it...

  1. Define the Model that we will attempt to load data into:
    Ext.define('Book', { extend: 'Ext.data.Model', fields: [{ name: 'Title', type: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required