Skip to content
Snippets Groups Projects
Commit 9388b09c authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: informative error loggins

parent 79e21fe3
No related branches found
No related tags found
No related merge requests found
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
......@@ -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({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment