It seems I can explicitly visit/redirect to an auto-created loading route, but not an error route. Is there any reason for this? Or way to work around it?
By "auto-created", I mean I have created loading and error templates, but haven't explicitly created routes or defined them in the router. The Ember docs explain that this will create a loading route, and implies (but does not explicitly state) that the same should be true for error routes.
The error I'm seeing looks as though the route doesn't exist:
DEBUG: -------------------------------
vendor.js:28585DEBUG: Ember : 1.8.1
vendor.js:28585DEBUG: Ember Data : 1.0.0-beta.12
vendor.js:28585DEBUG: Handlebars : 1.3.0
vendor.js:28585DEBUG: jQuery : 1.11.2
vendor.js:28585DEBUG: -------------------------------
vendor.js:28585Error: Assertion Failed: The URL '/error' did not match any routes in your application
at new Error (unknown source)
at Error.EmberError (http://ift.tt/1ErrDq7)
at Object.assert (http://ift.tt/1G3x2Cv)
at http://ift.tt/1ErrALd
at tryCatch (http://ift.tt/1G3x0uh)
at invokeCallback (http://ift.tt/1ErrDqe)
at http://ift.tt/1G3x0uj
at http://ift.tt/1ErrDGG
at http://ift.tt/1G3x2SQ
at Object.flush (http://ift.tt/1ErrDql)
vendor.js:17077Uncaught Error: Assertion Failed: Error: Assertion Failed: The URL '/error' did not match any routes in your application
But it is listed as an available route:
Ember.keys(Onboarding.Router.router.recognizer.names)
["loading", "error", ..., "index", "application"]
Despite this, explicitly adding it to the router:
Router.map(function() {
...
this.route("error");
});
does fix the issue.
Am I doing something silly? Or is this intended behavior?
Aucun commentaire:
Enregistrer un commentaire