fix: errorsController

not properly printing errors when headers already sent
This commit is contained in:
Bobby Wibowo 2022-07-12 08:05:45 +07:00
parent eb4057d10c
commit 26ae853362
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -13,8 +13,8 @@ const self = {
self.handleError = (req, res, error) => { self.handleError = (req, res, error) => {
if (!res || res.headersSent) { if (!res || res.headersSent) {
console.error('Unexpected missing "res" object or headers alredy sent.') console.error('Error: Unexpected missing "res" object or headers alredy sent.')
return console.trace() return console.error(error)
} }
// Error messages that can be returned to users // Error messages that can be returned to users