mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user