# Try to reload model on any ajax error

**URL:** <https://discuss.emberjs.com/t/try-to-reload-model-on-any-ajax-error/10452>\
**Category:** Uncategorized\
**Created:** [April 15, 2016, 7:24pm UTC](https://discuss.emberjs.com/t/try-to-reload-model-on-any-ajax-error/10452 "2016-04-15T19:24:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammy007](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@sammy007](https://discuss.emberjs.com/u/sammy007)\
**Post date:** [April 15, 2016, 7:24pm UTC](https://discuss.emberjs.com/t/try-to-reload-model-on-any-ajax-error/10452/1 "2016-04-15T19:24:43Z")

</div>

How I can make my app to continue poll for model every time backend fails? I already tried everything in order to achieve this behaviour, but seems I am not capable to do it properly. I use plain jquery ajax calls. I tried to retry current transition in catch-all error action:

```auto
// application route

actions: {
  error(error, transition) {
    if (error) {
      this.retryTransition(transition);
    }
  }
},

retryTransition(transition) {
  return Ember.run.later(this, () => {
    transition.retry().catch(() => {
      this.retryTransition(transition)
    })
  }, 5000);
}

```

In all routes with models I have the following code:

```auto
setupController: function(controller, model) {
  this._super(controller, model);
  Ember.run.later(this, this.refresh, 5000); // periodically poll backend for data
},

```

but only nested route model can back up after failure, and if I click parent links, models never update for these routes.

is there any recommended solution that I can use?
