mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-25 03:35:28 +00:00
Return 400 rather than 500
This commit is contained in:
parent
67f2c901ea
commit
c98e1479bd
@ -23,6 +23,7 @@ from synapse.util.async import ObservableDeferred
|
|||||||
from synapse.util.logcontext import preserve_fn, PreserveLoggingContext
|
from synapse.util.logcontext import preserve_fn, PreserveLoggingContext
|
||||||
from synapse.util.logutils import log_function
|
from synapse.util.logutils import log_function
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
|
from synapse.api.errors import SynapseError
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json
|
from canonicaljson import encode_canonical_json
|
||||||
from collections import deque, namedtuple
|
from collections import deque, namedtuple
|
||||||
@ -1324,7 +1325,9 @@ class EventsStore(SQLBaseStore):
|
|||||||
max_depth = max(row[0] for row in rows)
|
max_depth = max(row[0] for row in rows)
|
||||||
|
|
||||||
if max_depth <= topological_ordering:
|
if max_depth <= topological_ordering:
|
||||||
raise Exception("topological_ordering is greater than forward extremeties")
|
raise SynapseError(
|
||||||
|
400, "topological_ordering is greater than forward extremeties"
|
||||||
|
)
|
||||||
|
|
||||||
txn.execute(
|
txn.execute(
|
||||||
"SELECT event_id, state_key FROM events"
|
"SELECT event_id, state_key FROM events"
|
||||||
|
Loading…
Reference in New Issue
Block a user