chaplinjs/chaplin

Graceful handling of non-matching URLs

rgonzalezramos opened this issue · 2 comments

It would be nice for the framework to have a way to handle URLs that do not match any declared route. A default route, or at least the possibility to declare a wildcard route that serves as fallback when no route is matched would be awesome.

Currently, the applications just freeze. See this invalid route at ost.io where no exception is thrown and no event (i think) could be catch.

Like with the classical Backbone, you can use a catch-all route like this:

match '*anything', 'controllers/errors#notFound'

Then, in your error controller, the notFound handler display a 404 error page for example.

Oh, my mistake. Thank you for the answer.

2014-09-23 14:14 GMT+02:00 Florian-R notifications@github.com:

Like with the classical Backbone, you can use a catch-all route like this:

match '*anything', 'controllers/errors#notFound'

Then, in your error controller, the notFound handler display a 404 error
page for example.


Reply to this email directly or view it on GitHub
#833 (comment).

Roberto González Ramos
rgonzalezramos@gmail.com