How can I handle the error
Uncaught Error: No route matched the URL '...'
and show a custom 404 page?
Note: This question was asked before and answered several months ago - but does not work anymore.
App.Router.map(function() { //set up all of your known routes, and then... this.route("fourOhFour", { path: "*path"}); });
.. where you have your FourOhFourRoute defined to show the "no route found" message of your choosing. You will be able to access the originally requested path in the fourOhFour route as the path parameter.
EDIT: just for clarity -- this answer came after the others were reported not to work anymore.
EDIT 2: I've updated the answer to reflect Yehuda Katz's comment (if I have it wrong, please LMK).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With