title: ExtJS 4 - Accessing custom reponse headers within REST proxy and/or store?
body: <p>I've learned how to add custom headers to Ext-JS requests from this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/8045917/http-headers-with-extjs-4-stores">HTTP Headers with ExtJS 4 Stores</a></p>
  
  <p>And now I am trying to deal with the issue of exception handling when the problem is a user error.  This question is dealt with here:</p>
  
  <p><a href="https://stackoverflow.com/questions/2001773/understanding-rest-verbs-error-codes-and-authentication">Understanding REST: Verbs, error codes, and authentication</a></p>
  
  <p>One of the answers suggests mapping to the closest HTTP error code but then also using a custom response header to pass exception information back to the client.</p>
  
  <blockquote>
    <p>I'd strongly advise against extending the basic HTTP status codes. If you can't find one that matches your situation exactly, pick the closest one and put the error details in the response body. Also, remember that HTTP headers are extensible; your application can define all the custom headers that you like. One application that I worked on, for example, could return a 404 Not Found under multiple circumstances. Rather than making the client parse the response body for the reason, we just added a new header, X-Status-Extended, which contained our proprietary status code extensions. So you might see a response like:</p>
  </blockquote>
  
  <p><code>HTTP/1.1 404 Not Found<br>
  X-Status-Extended: 404.3 More Specific Error Here</code></p>
  
  <p>I like this idea a lot.  But cannot figure out how, from within ExtJS I could gain access to this custom response header to extract the exception message.</p>