iron / router

Router middleware for the Iron web framework.
165 stars 74 forks source link

custom 404 message #114

Closed ConnyOnny closed 8 years ago

ConnyOnny commented 8 years ago

Hey,

currently in router.rs it says:

self.handle_method(req, &path).unwrap_or(
    Err(IronError::new(NoRoute, status::NotFound))
)

It would be nice if this was less hardcoded and if it was possible to create a custom NotFound error page. Maybe add an optional special handler to the Router struct?

reem commented 8 years ago

You can catch the NoRoute error in an AfterMiddleware and render your own 404 page there. Does that solve your problem?

ConnyOnny commented 8 years ago

Yeah that solves it. Thanks.