mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 19:40:20 +00:00
Error handling
This commit is contained in:
parent
729ea933ea
commit
3640ddfbf6
1 changed files with 8 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
from twisted.internet import defer
|
||||
|
||||
from _base import SQLBaseStore
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
|
||||
|
||||
import logging
|
||||
|
@ -130,7 +131,13 @@ class SearchStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
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(
|
||||
"(topological_ordering < ?"
|
||||
" OR (topological_ordering = ? AND stream_ordering < ?))"
|
||||
|
|
Loading…
Reference in a new issue