diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-09-03 08:58:48 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-09-03 08:58:48 +0100 |
commit | 683596f91e3b074601d607b9e5891ab85b5629ca (patch) | |
tree | 932dd2fa480c7bac6afed11e749d38d322448a4d /synapse/handlers/_base.py | |
parent | rate limiting for message sending (diff) | |
download | synapse-683596f91e3b074601d607b9e5891ab85b5629ca.tar.xz |
Raise LimitExceedError when the ratelimiting is throttling requests
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r-- | synapse/handlers/_base.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index c150b60e07..935adea1ac 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -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), ) |