Ember.js: Top level ErrorRoute failed to handle error from nested routes.

Created on 21 Sep 2014  路  6Comments  路  Source: emberjs/ember.js

JSBin: http://emberjs.jsbin.com/qipekekarive/1/edit
When I have the following routes:

  this.resource('users', function(){
    this.route('show');
  });
  this.route('error');

Assume there is an error in ShowRoute model. When I navigate to ShowRoute, the error is supposed to bubble up to ErrorRoute. However I get the following message:
More context objects were passed than there are dynamic segments for the route: error

Isn't the ErrorRoute supposed to handle all errors in the whole application? Am I missing something or is this a bug?

Most helpful comment

Future Googlers: this tripped me up too (Ember 2.9.0-beta.5). If you ember g route error, make sure you remove the newly-added this.route('error'); from router.js.

All 6 comments

I know where the problem is.
I should not create a explicit error route.

Future Googlers: this tripped me up too (Ember 2.9.0-beta.5). If you ember g route error, make sure you remove the newly-added this.route('error'); from router.js.

I'm gonna be bold and ask @wycats to reopen this so the guide can be updated. I started doing crazy stuff like this.route('error', path: { '/:error' }); so the dynamic segment shown here would be available.

@jonblack what guide?

@locks The guide for error substates.

@jonblack please file an issue in the appropriate repository.

Was this page helpful?
0 / 5 - 0 ratings