mirror of
https://github.com/frappe/frappe.git
synced 2024-06-03 02:50:49 +00:00
fix: correct HTTP response code for rate limit
This commit is contained in:
parent
491c995313
commit
ea45d959b3
|
@ -122,7 +122,7 @@ class InvalidSignatureError(ValidationError):
|
|||
|
||||
|
||||
class RateLimitExceededError(ValidationError):
|
||||
pass
|
||||
http_status_code = 429
|
||||
|
||||
|
||||
class CannotChangeConstantError(ValidationError):
|
||||
|
|
|
@ -147,7 +147,8 @@ def rate_limit(
|
|||
value = frappe.cache.incrby(cache_key, 1)
|
||||
if value > _limit:
|
||||
frappe.throw(
|
||||
_("You hit the rate limit because of too many requests. Please try after sometime.")
|
||||
_("You hit the rate limit because of too many requests. Please try after sometime."),
|
||||
frappe.RateLimitExceededError,
|
||||
)
|
||||
|
||||
return fn(*args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue
Block a user