Try to reload model on any ajax error


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:

// application route

actions: {
  error(error, transition) {
    if (error) {

retryTransition(transition) {
  return, () => {
    transition.retry().catch(() => {
  }, 5000);

In all routes with models I have the following code:

setupController: function(controller, model) {
  this._super(controller, model);, 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?