summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/_base.py6
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),
             )