Skip to content

Commit

Permalink
#fix: 369
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Oct 31, 2023
1 parent 12e519c commit e782f17
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 172 deletions.
7 changes: 7 additions & 0 deletions lib/handlers/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const handler = (err, req, res) => {
message: err.message
})
}
if (err.name && err.name === 'UnauthorizedError') {
return res.status(401).send({
statusCode: 401,
error: 'Unauthorized',
message: err.message
})
}
asyncLogError(err, req.log)
return res.status(500).send({
statusCode: 500,
Expand Down
Loading

0 comments on commit e782f17

Please sign in to comment.