mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #19242 from overleaf/em-api-error-handlers
Handle more errors in the global API error handler GitOrigin-RevId: add31e2de067e8534f2eb3932623c2413c4ce6d8
This commit is contained in:
parent
898f6c81c8
commit
194d778c28
1 changed files with 6 additions and 0 deletions
|
@ -100,6 +100,12 @@ function handleApiError(err, req, res, next) {
|
|||
) {
|
||||
req.logger.setLevel('warn')
|
||||
res.sendStatus(400)
|
||||
} else if (err instanceof Errors.TooManyRequestsError) {
|
||||
req.logger.setLevel('warn')
|
||||
res.sendStatus(429)
|
||||
} else if (err instanceof Errors.ForbiddenError) {
|
||||
req.logger.setLevel('warn')
|
||||
res.sendStatus(403)
|
||||
} else {
|
||||
req.logger.setLevel('error')
|
||||
res.sendStatus(500)
|
||||
|
|
Loading…
Reference in a new issue