Add a stack trace to the 500 page in dev mode

This commit is contained in:
Rowan Manning
2013-09-27 15:13:21 +01:00
parent d30dc04319
commit 4f38eaecc4
2 changed files with 7 additions and 2 deletions

3
app.js
View File

@@ -66,6 +66,9 @@ function initApp (config, callback) {
app.express.use(function (err, req, res, next) {
/* jshint unused: false */
app.emit('route-error', err);
if (process.env.NODE_ENV !== 'production') {
res.locals.error = err;
}
res.status(500);
res.render('500');
});