1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    22
    Vote Rating
    0
    sophicworks is on a distinguished road

      0  

    Default Unanswered: how to check status code when loading files

    Unanswered: how to check status code when loading files


    Good day, I'am new to to extjs and I wanted to know if there's a way to always check the
    status code for all the request (getting .js files like app.store.myStore.js or requesting data from the server with unknown url: 'url/unknown' and prevent decoding invalid JSON format response) or determine
    any failure in request that could crash my application.

    The main point is I wanted to know if there is a way to check or trap the error if the status code is not 200 OK, so that I can prompt a warning or error message or redirect my url to other pages (like login page)

    Thanks and below I attached sample Images of the errors I want to trap

    Status Request 404 Not Found.png

    Invalid JSON Format.png
    Attached Images

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should only have those issues in development as you should be taking care of the issues before you go into production.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.