adding type and subtype to rate limit error
This commit is contained in:
@@ -45,6 +45,8 @@ function rateLimit(userLimitsApi, endpointGroup = null) {
|
||||
if (isBlocked) {
|
||||
const rateLimitError = new Error('You are over the limits.');
|
||||
rateLimitError.http_status = 429;
|
||||
rateLimitError.type = 'limit';
|
||||
rateLimitError.subtype = 'rate-limit';
|
||||
return next(rateLimitError);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user