From: Benjamin Auder <benjamin.auder@somewhere> 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/%7B%7B%20asset('mixstore/current/pieces/cb.svg?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( "<h1>" + err.message + "</h1>" + - "<h2>" + err.status + "</h2>" + - "<pre>" + err.stack + "</pre>" + "<h2>" + err.status + "</h2>" ); });