Results 1 to 3 of 3

Thread: null response parameter for proxy exception for a HTTP 401 Unauthorized

  1. #1
    Ext JS Premium Member cmeans's Avatar
    Join Date
    Jun 2010
    Location
    Chicago, IL USA
    Posts
    117
    Answers
    3

    Question Answered: null response parameter for proxy exception for a HTTP 401 Unauthorized

    Hi,

    ExtJS v4.1.3

    I have a Store that's retrieving data via JSONP. However, if I don't pass in a valid authorization code, the remote service, correctly, returns an HTTP 401 Unauthorized. Though there are other cases like a 403 Forbidden (if I make too many requests, even with a valid authorization code).

    Though I can catch the proxy exception, I'm getting a null response object (2nd parameter), which means I can't check the status to see if it was a 401, a 403 or something else.

    I have tested the remote service via the browser, and it is returned the correct HTTP status code. The issue is that my ExtJS code can't seem to get that HTTP status code.

    Any suggestions?

    Thanks.

    -Chris

  2. I could be mistaken but I wasn't aware that it was possible to access the status code when using JSON-P (and I'm not referring specifically to ExtJS here). In that case it is better for the server to return a 200 code and use a success property to communicate the error, with other properties containing relevant details.

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    I could be mistaken but I wasn't aware that it was possible to access the status code when using JSON-P (and I'm not referring specifically to ExtJS here). In that case it is better for the server to return a 200 code and use a success property to communicate the error, with other properties containing relevant details.

  4. #3
    Ext JS Premium Member cmeans's Avatar
    Join Date
    Jun 2010
    Location
    Chicago, IL USA
    Posts
    117
    Answers
    3

    Default

    Yes, I believe you're right.

    It's a major bummer, and I wished I'd remembered this...would have saved me a lot of debugging.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •