Skip to content

Commit

Permalink
Change error response format
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Feb 22, 2019
1 parent 3c2f1c1 commit 000295f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/middlewares/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ const { HTTPError } = require('../errors')
const HTTPErrorHandler = (err, req, res, next) => {
if (err instanceof HTTPError) {
return res.status(err.statusCode).json({
success: false,
msg: err.message
error: {
code: err.statusCode,
msg: err.message
}
})
}

Expand Down

0 comments on commit 000295f

Please sign in to comment.