From 0da7d5b86e5c0e0acf2fb763f93ac3b3509c066b Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Thu, 20 Feb 2020 13:24:15 +0100
Subject: [PATCH] Do not show full stack in case of error

---
 server/app.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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>"
   );
 });
 
-- 
2.44.0