From 26ae85336264aef45027a6899ce1fc1752b6cd50 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Tue, 12 Jul 2022 08:05:45 +0700 Subject: [PATCH] fix: errorsController not properly printing errors when headers already sent --- controllers/errorsController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/errorsController.js b/controllers/errorsController.js index a37cab6..7d22687 100644 --- a/controllers/errorsController.js +++ b/controllers/errorsController.js @@ -13,8 +13,8 @@ const self = { self.handleError = (req, res, error) => { if (!res || res.headersSent) { - console.error('Unexpected missing "res" object or headers alredy sent.') - return console.trace() + console.error('Error: Unexpected missing "res" object or headers alredy sent.') + return console.error(error) } // Error messages that can be returned to users