Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9020827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:06:51+00:00 2026-06-16T05:06:51+00:00

I’ve learned how to add custom headers to Ext-JS requests from this question: HTTP

  • 0

I’ve learned how to add custom headers to Ext-JS requests from this question:

HTTP Headers with ExtJS 4 Stores

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:

Understanding REST: Verbs, error codes, and authentication

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.

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:

HTTP/1.1 404 Not Found
X-Status-Extended: 404.3 More Specific Error Here

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:06:52+00:00Added an answer on June 16, 2026 at 5:06 am

    Response object has a getAllResponseHeader() method that you can use to have access to all the header key-value pairs.

    In Extjs you can do something like this:

    Ext.Ajax.request({
        url: 'www.microsoft.com',
        method: 'GET',
        failure: function(response){
            console.log(response.getAllResponseHeaders());
         }
    });​
    

    This returns an instance with this info:

    connection: "keep-alive"
    content-encoding: "gzip"
    content-type: "text/html; charset=utf-8"
    date: "Thu, 13 Dec 2012 03:10:15 GMT"
    server: "nginx/0.8.54"
    transfer-encoding: "chunked"
    vary: "Cookie"
    

    In your case you should do the following:

        failure: function(response){
            var header = response.getAllResponseHeaders(),
                statusEx = header['X-Status-Extended'];
    
            if(statusEx === '404.3 More Specific Error Here'){
                // do something here
            }
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.