From 9388b09c75f98ef6d34fc67e67e3c896016d3bcd Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Wed, 24 Apr 2019 14:41:39 +0200
Subject: [PATCH] chore: informative error loggins

---
 deploy/catchError.js         | 8 ++++++--
 deploy/nehubaConfig/index.js | 1 -
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/deploy/catchError.js b/deploy/catchError.js
index e2dba558a..f78a42919 100644
--- a/deploy/catchError.js
+++ b/deploy/catchError.js
@@ -1,7 +1,11 @@
-module.exports = ({code = 500, error = 'an error had occured'}, req, res, next) => {
+module.exports = ({code = 500, error = 'an error had occured', trace = 'undefined trace'}, req, res, next) => {
   /**
    * probably use more elaborate logging?
    */
-  console.log('Catching error', JSON.stringify(error))
+  console.log('Catching error', {
+    code,
+    error,
+    trace
+  })
   res.sendStatus(code)
 }
\ No newline at end of file
diff --git a/deploy/nehubaConfig/index.js b/deploy/nehubaConfig/index.js
index 1ae4c77b9..a5072c828 100644
--- a/deploy/nehubaConfig/index.js
+++ b/deploy/nehubaConfig/index.js
@@ -7,7 +7,6 @@ const nehubaConfigRouter = express.Router()
 
 nehubaConfigRouter.get('/:configId', (req, res, next) => {
   const { configId } = req.params
-  console.log('nehubaconfigrouter')
   getTemplateNehubaConfig(configId)
     .then(data => res.status(200).send(data))
     .catch(error => next({
-- 
GitLab