Skip to content

Commit

Permalink
fix the 404 error page to actually show the error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaarlo Kananen committed Jul 28, 2015
1 parent b694870 commit 0e2f994
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ app.use(function(req, res, next)

if (disallowedPaths.indexOf(path) > -1)
{
return res.status(404).send();
var err = new Error('Not found: '+path);
err.status = 404;

return next(err);
}

next();
Expand Down Expand Up @@ -544,6 +547,7 @@ app.use(function(err, req, res, next) {
return res.json({ message: err.message });

res.render('error', {
layout: 'min',
message: err.message,
error: {}
});
Expand Down

0 comments on commit 0e2f994

Please sign in to comment.