diff options
author | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-07-24 15:24:44 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-30 16:50:16 +0100 |
commit | b3962979301c3736f94481fa42c875f9a920eadc (patch) | |
tree | 308a9217bb04ebccacdb045238a9c01a9c0a043a | |
parent | Select m.room.create event ID as a JOIN. (diff) | |
download | synapse-b3962979301c3736f94481fa42c875f9a920eadc.tar.xz |
Give a proper error for invalid pagination tokens.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r-- | synapse/handlers/room_list.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index e24f82f327..4774905c40 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -25,6 +25,7 @@ from twisted.internet import defer from synapse.api.constants import EventTypes, JoinRules from synapse.api.errors import Codes, HttpResponseException +from synapse.api.errors import SynapseError from synapse.types import ThirdPartyInstanceID from synapse.util.caches.descriptors import cachedInlineCallbacks from synapse.util.caches.response_cache import ResponseCache @@ -135,12 +136,12 @@ class RoomListHandler(BaseHandler): timing out. TODO """ pagination_token = None - if since_token and since_token != "END": # todo ought we support END and START? + if since_token and since_token != "END": if since_token[0] in ("+", "-"): forwards = since_token[0] == "+" pagination_token = since_token[1:] else: - raise SyntaxError("shrug ") # TODO + raise SynapseError(400, "Invalid since token.") else: forwards = True |