fix(errors): show stack trace on prod
This commit is contained in:
committed by
Benedikt Rötsch
parent
2eb85dc718
commit
699894b02d
4
app.js
4
app.js
@@ -124,8 +124,8 @@ app.use(function (request, response, next) {
|
||||
|
||||
// Error handler
|
||||
app.use(function (err, request, response, next) {
|
||||
// Set locals, only providing error in development
|
||||
response.locals.error = request.app.get('env') === 'development' ? err : {}
|
||||
// Set error in locals
|
||||
response.locals.error = err
|
||||
response.locals.error.status = err.status || 500
|
||||
// Render the error page
|
||||
response.status(err.status || 500)
|
||||
|
||||
Reference in New Issue
Block a user