From ed50c8ba172e04fe15364e7c36381b7139e2a81a Mon Sep 17 00:00:00 2001
From: Louis-Marie Michelin <lmichelin@outlook.fr>
Date: Tue, 8 Jun 2021 21:26:16 +0200
Subject: [PATCH] fix(errorHandler): use error.stack instead of
 error.toString') to get more details during development

---
 backend/services/jsonErrorHandler.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/services/jsonErrorHandler.js b/backend/services/jsonErrorHandler.js
index 0a69a05..2627c7d 100644
--- a/backend/services/jsonErrorHandler.js
+++ b/backend/services/jsonErrorHandler.js
@@ -4,7 +4,7 @@
 const jsonErrorHandler = function (error, req, res, next) {
   if (!res.headersSent) {
     if (process.env.NODE_ENV === "development") {
-      res.status(500).json({ message: error.toString() });
+      res.status(500).json({ message: error.stack });
     } else {
       // Hide error details in production to avoid security issues
       res.status(500).json({ message: "Internal server error" });
-- 
GitLab