summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-12-22 15:49:32 +0000
committerMark Haines <mark.haines@matrix.org>2015-12-22 15:49:32 +0000
commit0ee01383252cafd30ed92e3b655847d07cacee3a (patch)
tree593bd0facf7ffd5508ba105f8a15023d36becf30 /synapse/handlers
parentUse a list comprehension (diff)
downloadsynapse-0ee01383252cafd30ed92e3b655847d07cacee3a.tar.xz
Include the list of bad room ids in the error
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/sync.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py

index 38c185cd54..feea407ea2 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -16,7 +16,7 @@ from ._base import BaseHandler from synapse.api.constants import Membership, EventTypes -from synapse.api.errors import AuthError +from synapse.api.errors import GuestAccessError from synapse.util import unwrapFirstError from twisted.internet import defer @@ -139,10 +139,16 @@ class SyncHandler(BaseHandler): """ if sync_config.is_guest: + bad_rooms = [] for room_id in sync_config.filter.list_rooms(): world_readable = yield self._is_world_readable(room_id) if not world_readable: - raise AuthError(403, "Guest access not allowed") + bad_rooms.append(room_id) + + if bad_rooms: + raise GuestAccessError( + bad_rooms, 403, "Guest access not allowed" + ) if timeout == 0 or since_token is None or full_state: # we are going to return immediately, so don't bother calling