mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-31 16:38:39 -04:00
Raise LimitExceedError when the ratelimiting is throttling requests
This commit is contained in:
parent
780548b577
commit
683596f91e
2 changed files with 29 additions and 11 deletions
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
from twisted.internet import defer
|
||||
from synapse.api.errors import cs_error, Codes
|
||||
from synapse.api.errors import LimitExceededError
|
||||
|
||||
class BaseHandler(object):
|
||||
|
||||
|
@ -38,9 +38,7 @@ class BaseHandler(object):
|
|||
burst_count=self.hs.config.rc_message_burst_count,
|
||||
)
|
||||
if not allowed:
|
||||
raise cs_error(
|
||||
"Limit exceeded",
|
||||
Codes.LIMIT_EXCEEDED,
|
||||
raise LimitExceededError(
|
||||
retry_after_ms=1000*(time_allowed - time_now),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue