title: How to get the REST response message in ExtJs 4?
body: <p>I'm building upon <a href="http://dev.sencha.com/deploy/ext-4.0.0/examples/restful/restful.html" rel="noreferrer">RESTFul Store example</a> of ExtJs 4. I'd like my script to display errors provided by the REST server, when either Add or Delete request fails. I've managed to obtain the success status of a request (see the code below), but how do I reach the message provided with the response?</p>
  
  <p>Store:</p>
  
  <pre><code>    var store = Ext.create('Ext.data.Store', {
      model: 'Users',
      autoLoad: true,
      autoSync: true,
      proxy: {
          type: 'rest',
          url: 'test.php',
          reader: {
              type: 'json',
              root: 'data',
              model: 'Users'
          },
          writer: {
              type: 'json'
          },
          afterRequest: function(request, success) {
              console.log(success); // either true or false
          },
          listeners: { 
              exception: function(proxy, response, options) {
  
                  // response contains responseText, which has the message
                  // but in unparsed Json (see below) - so I think 
                  // there should be a better way to reach it than 
                  // parse it myself
  
                  console.log(proxy, response, options); 
              }
          }
      }
  });
  </code></pre>
  
  <p>Typical REST response:</p>
  
  <pre><code>"{"success":false,"data":"","message":"VERBOSE ERROR"}"
  </code></pre>
  
  <p>Perhaps I'm doing it all wrong, so any advice is appreciated.</p>