I am trying to implement a few different error page inside my app. In the application template I am doing the following:
error(error, transition) {
console.error(error);
if (error && error.errors && error.errors[0] && error.errors[0].status === "403") {
this.transitionTo('forbidden');
} else if (error instanceof Ember.Error) {
this.transitionTo('error');
} else {
this.transitionTo('error');
}
}
This works, but changes window location. I would like the location to stay the same, so a refresh on the site would try to load the last page accesses and not just refresh the error page.
Whats the best way to do this? I tried replacing transitionTo with render, but it gives a wierd error: Uncaught TypeError: Cannot read property ‘push’ of undefined