From 0993b05ca56198ac8ffe5ad6dea280b8fd99d0cf Mon Sep 17 00:00:00 2001 From: "Amber H. Brown" Date: Mon, 1 Jul 2019 23:13:21 +1000 Subject: [PATCH] improve error text when room is too large --- synapse/handlers/room_member.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 08214692f545..a65832efed90 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -38,6 +38,11 @@ logger = logging.getLogger(__name__) id_server_scheme = "https://" +ROOM_COMPLEXITY_TOO_GREAT = ( + "Your homeserver is unable to join rooms this large or complex. " + "Please speak to your server administrator, or upgrade your instance " + "to join this room." +) class RoomMemberHandler(object): @@ -1087,9 +1092,8 @@ def _remote_join(self, requester, remote_room_hosts, room_id, user, content): room_id, remote_room_hosts ) if too_complex is True: - msg = "Room too large (preflight)" raise SynapseError( - code=400, msg=msg, + code=400, msg=ROOM_COMPLEXITY_TOO_GREAT, errcode=Codes.RESOURCE_LIMIT_EXCEEDED ) @@ -1129,9 +1133,8 @@ def _remote_join(self, requester, remote_room_hosts, room_id, user, content): room_id=room_id, action="leave" ) - msg = "Room too large (postflight)" raise SynapseError( - code=400, msg=msg, + code=400, msg=ROOM_COMPLEXITY_TOO_GREAT, errcode=Codes.RESOURCE_LIMIT_EXCEEDED )