summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-06-12 16:29:56 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-06-12 16:29:56 +0100
commit8400e5f6247de4b4382b2e3866a98a87826c4cd7 (patch)
treef14e1205a95947c91439b2b17ea1be1bc86f4438 /synapse/api/errors.py
parentGenerate sample config (diff)
parentRegenerate full schemas (diff)
downloadsynapse-8400e5f6247de4b4382b2e3866a98a87826c4cd7.tar.xz
Merge branch 'dinsic' into babolivier/userdir_hide_users
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py

index e6c67acf96..e46bfdfcb9 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py
@@ -336,9 +336,32 @@ class RoomKeysVersionError(SynapseError): self.current_version = current_version +class UnsupportedRoomVersionError(SynapseError): + """The client's request to create a room used a room version that the server does + not support.""" + def __init__(self): + super(UnsupportedRoomVersionError, self).__init__( + code=400, + msg="Homeserver does not support this room version", + errcode=Codes.UNSUPPORTED_ROOM_VERSION, + ) + + +class ThreepidValidationError(SynapseError): + """An error raised when there was a problem authorising an event.""" + + def __init__(self, *args, **kwargs): + if "errcode" not in kwargs: + kwargs["errcode"] = Codes.FORBIDDEN + super(ThreepidValidationError, self).__init__(*args, **kwargs) + + class IncompatibleRoomVersionError(SynapseError): - """A server is trying to join a room whose version it does not support.""" + """A server is trying to join a room whose version it does not support. + Unlike UnsupportedRoomVersionError, it is specific to the case of the make_join + failing. + """ def __init__(self, room_version): super(IncompatibleRoomVersionError, self).__init__( code=400,