diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-08-02 17:38:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 17:38:24 +0100 |
commit | 1fa98495d0735093cb5e91a375b3b0516f5d58d6 (patch) | |
tree | 37be034fdef9706cb9c85e1ee132c351ea3b1397 /synapse/replication/http/send_event.py | |
parent | Merge pull request #3638 from matrix-org/rav/refactor_federation_client_excep... (diff) | |
parent | changelog (diff) | |
download | synapse-1fa98495d0735093cb5e91a375b3b0516f5d58d6.tar.xz |
Merge pull request #3639 from matrix-org/rav/refactor_error_handling
Clean up handling of errors from outbound requests
Diffstat (limited to 'synapse/replication/http/send_event.py')
-rw-r--r-- | synapse/replication/http/send_event.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/replication/http/send_event.py b/synapse/replication/http/send_event.py index 5227bc333d..d3509dc288 100644 --- a/synapse/replication/http/send_event.py +++ b/synapse/replication/http/send_event.py @@ -18,11 +18,7 @@ import re from twisted.internet import defer -from synapse.api.errors import ( - CodeMessageException, - MatrixCodeMessageException, - SynapseError, -) +from synapse.api.errors import CodeMessageException, HttpResponseException from synapse.events import FrozenEvent from synapse.events.snapshot import EventContext from synapse.http.servlet import RestServlet, parse_json_object_from_request @@ -83,11 +79,11 @@ def send_event_to_master(clock, store, client, host, port, requester, event, con # If we timed out we probably don't need to worry about backing # off too much, but lets just wait a little anyway. yield clock.sleep(1) - except MatrixCodeMessageException as e: + except HttpResponseException 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) + raise e.to_synapse_error() defer.returnValue(result) |