diff options
author | Erik Johnston <erik@matrix.org> | 2018-08-22 17:06:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-08-22 17:06:10 +0100 |
commit | fd2dbf183676804cb6925972e67969c51c1a4074 (patch) | |
tree | 9a9344671dc650b85a5bd42b0fb9d6649ae0834f /synapse/crypto/keyclient.py | |
parent | Update notice format (diff) | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-fd2dbf183676804cb6925972e67969c51c1a4074.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into neilj/server_notices_on_blocking
Diffstat (limited to 'synapse/crypto/keyclient.py')
-rw-r--r-- | synapse/crypto/keyclient.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/crypto/keyclient.py b/synapse/crypto/keyclient.py index c20a32096a..e94400b8e2 100644 --- a/synapse/crypto/keyclient.py +++ b/synapse/crypto/keyclient.py @@ -18,7 +18,9 @@ import logging from canonicaljson import json from twisted.internet import defer, reactor +from twisted.internet.error import ConnectError from twisted.internet.protocol import Factory +from twisted.names.error import DomainError from twisted.web.http import HTTPClient from synapse.http.endpoint import matrix_federation_endpoint @@ -47,12 +49,14 @@ def fetch_server_key(server_name, tls_client_options_factory, path=KEY_API_V1): server_response, server_certificate = yield protocol.remote_key defer.returnValue((server_response, server_certificate)) except SynapseKeyClientError as e: - logger.exception("Error getting key for %r" % (server_name,)) + logger.warn("Error getting key for %r: %s", server_name, e) if e.status.startswith("4"): # Don't retry for 4xx responses. raise IOError("Cannot get key for %r" % server_name) + except (ConnectError, DomainError) as e: + logger.warn("Error getting key for %r: %s", server_name, e) except Exception as e: - logger.exception(e) + logger.exception("Error getting key for %r", server_name) raise IOError("Cannot get key for %r" % server_name) |