adding type and subtype to rate limit error

This commit is contained in:
Simon Martín
2018-03-14 17:27:59 +01:00
parent bbedc5f41b
commit cbfeb0158e
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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);
}