From: Benjamin Auder Date: Thu, 20 Feb 2020 12:24:15 +0000 (+0100) Subject: Do not show full stack in case of error X-Git-Url: https://git.auder.net/doc/html/css/scripts/css/index.css?a=commitdiff_plain;h=0da7d5b86e5c0e0acf2fb763f93ac3b3509c066b;p=vchess.git Do not show full stack in case of error --- diff --git a/server/app.js b/server/app.js index b8a6aec7..eced7d33 100644 --- a/server/app.js +++ b/server/app.js @@ -55,10 +55,11 @@ app.use(function(req, res, next) { // error handler app.use(function(err, req, res, next) { res.status(err.status || 500); + if (app.get('env') === 'development') + console.log(err.stack); res.send( "

" + err.message + "

" + - "

" + err.status + "

" + - "
" + err.stack + "
" + "

" + err.status + "

" ); });