Skip to content

Commit

Permalink
companion,companion-client: use request ID in error json
Browse files Browse the repository at this point in the history
  • Loading branch information
ifedapoolarewaju committed Jul 10, 2019
1 parent f3dbae8 commit 53e550f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/standalone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ app.use((req, res, next) => {
if (app.get('env') === 'production') {
// @ts-ignore
app.use((err, req, res, next) => {
console.error('\x1b[31m', err, '\x1b[0m')
res.status(err.status || 500).json({ message: 'Something went wrong' })
console.error('\x1b[31m', req.id, err, '\x1b[0m')
res.status(err.status || 500).json({ message: 'Something went wrong', requestId: req.id })
})
} else {
// @ts-ignore
app.use((err, req, res, next) => {
console.error('\x1b[31m', err, '\x1b[0m')
res.status(err.status || 500).json({ message: err.message, error: err })
console.error('\x1b[31m', req.id, err, '\x1b[0m')
res.status(err.status || 500).json({ message: err.message, error: err, requestId: req.id })
})
}

Expand Down

0 comments on commit 53e550f

Please sign in to comment.