Skip to content
Snippets Groups Projects
Commit 3640ddfb authored by Erik Johnston's avatar Erik Johnston
Browse files

Error handling

parent 729ea933
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
from twisted.internet import defer from twisted.internet import defer
from _base import SQLBaseStore from _base import SQLBaseStore
from synapse.api.errors import SynapseError
from synapse.storage.engines import PostgresEngine, Sqlite3Engine from synapse.storage.engines import PostgresEngine, Sqlite3Engine
import logging import logging
...@@ -130,7 +131,13 @@ class SearchStore(SQLBaseStore): ...@@ -130,7 +131,13 @@ class SearchStore(SQLBaseStore):
) )
if pagination_token: if pagination_token:
topo, stream = pagination_token.split(",") try:
topo, stream = pagination_token.split(",")
topo = int(topo)
stream = int(stream)
except:
raise SynapseError(400, "Invalid pagination token")
clauses.append( clauses.append(
"(topological_ordering < ?" "(topological_ordering < ?"
" OR (topological_ordering = ? AND stream_ordering < ?))" " OR (topological_ordering = ? AND stream_ordering < ?))"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment