Handle more errors in the global API error handler GitOrigin-RevId: add31e2de067e8534f2eb3932623c2413c4ce6d8
@@ -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) {
+ res.sendStatus(403)
} else {
req.logger.setLevel('error')
res.sendStatus(500)