mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 14:43:53 +01:00
Merge pull request #2872 from matrix-org/erikj/event_worker_dont_log
Don't log errors propogated from send_event
This commit is contained in:
commit
5fb347fc41
1 changed files with 10 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
from synapse.api.errors import SynapseError, MatrixCodeMessageException
|
||||||
from synapse.events import FrozenEvent
|
from synapse.events import FrozenEvent
|
||||||
from synapse.events.snapshot import EventContext
|
from synapse.events.snapshot import EventContext
|
||||||
from synapse.http.servlet import RestServlet, parse_json_object_from_request
|
from synapse.http.servlet import RestServlet, parse_json_object_from_request
|
||||||
|
@ -27,6 +28,7 @@ import re
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@defer.inlineCallbacks
|
||||||
def send_event_to_master(client, host, port, requester, event, context):
|
def send_event_to_master(client, host, port, requester, event, context):
|
||||||
"""Send event to be handled on the master
|
"""Send event to be handled on the master
|
||||||
|
|
||||||
|
@ -48,7 +50,14 @@ def send_event_to_master(client, host, port, requester, event, context):
|
||||||
"requester": requester.serialize(),
|
"requester": requester.serialize(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.post_json_get_json(uri, payload)
|
try:
|
||||||
|
result = yield client.post_json_get_json(uri, payload)
|
||||||
|
except MatrixCodeMessageException as e:
|
||||||
|
# We convert to SynapseError as we know that it was a SynapseError
|
||||||
|
# on the master process that we should send to the client. (And
|
||||||
|
# importantly, not stack traces everywhere)
|
||||||
|
raise SynapseError(e.code, e.msg, e.errcode)
|
||||||
|
defer.returnValue(result)
|
||||||
|
|
||||||
|
|
||||||
class ReplicationSendEventRestServlet(RestServlet):
|
class ReplicationSendEventRestServlet(RestServlet):
|
||||||
|
|
Loading…
Reference in a new issue