diff options
author | Daniel Wagner-Hall <dawagner@gmail.com> | 2015-10-23 11:26:03 +0100 |
---|---|---|
committer | Daniel Wagner-Hall <dawagner@gmail.com> | 2015-10-23 11:26:03 +0100 |
commit | 216c976399eb2e0806407d357da2ca80374cabea (patch) | |
tree | 586ff8802da3917add3507ab49c3e81e390f0387 /synapse/api/errors.py | |
parent | Merge branch 'release-v0.10.1' of github.com:matrix-org/synapse into develop (diff) | |
parent | Reject events which are too large (diff) | |
download | synapse-216c976399eb2e0806407d357da2ca80374cabea.tar.xz |
Merge pull request #323 from matrix-org/daniel/sizelimits
Reject events which are too large
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r-- | synapse/api/errors.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py index d1356eb4d9..b3fea27d0e 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py @@ -119,6 +119,15 @@ class AuthError(SynapseError): super(AuthError, self).__init__(*args, **kwargs) +class EventSizeError(SynapseError): + """An error raised when an event is too big.""" + + def __init__(self, *args, **kwargs): + if "errcode" not in kwargs: + kwargs["errcode"] = Codes.TOO_LARGE + super(EventSizeError, self).__init__(413, *args, **kwargs) + + class EventStreamError(SynapseError): """An error raised when there a problem with the event stream.""" def __init__(self, *args, **kwargs): |