Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
improve error text when room is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl committed Jul 1, 2019
1 parent e001115 commit 0993b05
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
)

Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit 0993b05

Please sign in to comment.