1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    125
    Vote Rating
    0
    oddz is on a distinguished road

      0  

    Default Gracefully Handling External Request Timeout and Errors

    Gracefully Handling External Request Timeout and Errors


    It seems like a common problem I am running into is that quit frequently requests timeout due to a less than ideal network connection. Other than increasing the timeout for a request I was wondering if anyone else had recommendations or implementations of gracefully handling this issue. From my own experience it seems like it would be ideal to carry out an action which takes the person back to the previous item when a card switch occurs. Than prompt them with a message to try again. However, I would like to establish a global way of achieving this, rather than replicating similar code every where. It seems like long term though that this may me something to consider when developing the routing or history implementation?

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,144
    Vote Rating
    855
    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


    Listening to the exception event on a Store should handle getting these timeouts or bad status codes. Then if you have history and need to go back, call the browser's history.back()
    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.

Thread Participants: 1