Skip to content
Snippets Groups Projects
Unverified Commit 3828dd81 authored by reivilibre's avatar reivilibre Committed by GitHub
Browse files

Pass through `SynapseError`s that are raised from experimental...

Pass through `SynapseError`s that are raised from experimental `check_event_allowed` callback of the module API (#11042)

Co-authored-by: default avatarBrendan Abolivier <babolivier@matrix.org>
parent 4c838112
No related branches found
No related tags found
No related merge requests found
Work around a regression, introduced in Synapse 1.39.0, that caused `SynapseError`s raised by the experimental third-party rules module callback `check_event_allowed` to be ignored.
......@@ -217,6 +217,15 @@ class ThirdPartyEventRules:
for callback in self._check_event_allowed_callbacks:
try:
res, replacement_data = await callback(event, state_events)
except SynapseError as e:
# FIXME: Being able to throw SynapseErrors is relied upon by
# some modules. PR #10386 accidentally broke this ability.
# That said, we aren't keen on exposing this implementation detail
# to modules and we should one day have a proper way to do what
# is wanted.
# This module callback needs a rework so that hacks such as
# this one are not necessary.
raise e
except Exception as e:
logger.warning("Failed to run module API callback %s: %s", callback, e)
continue
......
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