Show error no matter if production or development

This commit is contained in:
supositware 2021-06-13 16:12:43 +02:00
parent bd9e4cee36
commit 05b765c6f0

4
app.js
View file

@ -27,9 +27,9 @@ app.use(function(req, res, next) {
// error handler // error handler
app.use(function(err, req, res, next) { app.use(function(err, req, res, next) {
// set locals, only providing error in development // set locals
res.locals.message = err.message; res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {}; res.locals.error = err;
// render the error page // render the error page
res.status(err.status || 500); res.status(err.status || 500);