diff options
author | Erik Johnston <erik@matrix.org> | 2019-06-17 13:54:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-17 13:54:47 +0100 |
commit | 6840ebeef84a2f7c06b71124e8b11b9918e41f2e (patch) | |
tree | 899c96afb7e87564080143074b0603f5c96f8021 /synapse/replication | |
parent | Merge pull request #5388 from matrix-org/erikj/fix_email_push (diff) | |
parent | Handle failing to talk to master over replication (diff) | |
download | synapse-6840ebeef84a2f7c06b71124e8b11b9918e41f2e.tar.xz |
Merge pull request #5385 from matrix-org/erikj/reduce_http_exceptions
Handle HttpResponseException when using federation client.
Diffstat (limited to 'synapse/replication')
-rw-r--r-- | synapse/replication/http/_base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py index e81456ab2b..0a432a16fa 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py @@ -17,11 +17,17 @@ import abc import logging import re +from six import raise_from from six.moves import urllib from twisted.internet import defer -from synapse.api.errors import CodeMessageException, HttpResponseException +from synapse.api.errors import ( + CodeMessageException, + HttpResponseException, + RequestSendFailed, + SynapseError, +) from synapse.util.caches.response_cache import ResponseCache from synapse.util.stringutils import random_string @@ -175,6 +181,8 @@ class ReplicationEndpoint(object): # on the master process that we should send to the client. (And # importantly, not stack traces everywhere) raise e.to_synapse_error() + except RequestSendFailed as e: + raise_from(SynapseError(502, "Failed to talk to master"), e) defer.returnValue(result) |