Reject events which are too large

SPEC-222
This commit is contained in:
Daniel Wagner-Hall 2015-10-22 11:44:31 +01:00
parent 8627048787
commit e60dad86ba
2 changed files with 30 additions and 1 deletions

View file

@ -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):