Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't log errors propogated from send_event #2872

Merged
merged 1 commit into from
Feb 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion synapse/replication/http/send_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from twisted.internet import defer

from synapse.api.errors import SynapseError, MatrixCodeMessageException
from synapse.events import FrozenEvent
from synapse.events.snapshot import EventContext
from synapse.http.servlet import RestServlet, parse_json_object_from_request
Expand All @@ -27,6 +28,7 @@
logger = logging.getLogger(__name__)


@defer.inlineCallbacks
def send_event_to_master(client, host, port, requester, event, context):
"""Send event to be handled on the master

Expand All @@ -48,7 +50,14 @@ def send_event_to_master(client, host, port, requester, event, context):
"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):
Expand Down