diff options
author | Erik Johnston <erik@matrix.org> | 2019-08-22 13:41:57 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-08-22 13:41:57 +0100 |
commit | 1e4b4d85e7f4604d0617bba01b279f3dc2ced1d2 (patch) | |
tree | 99baa32e4bc755be4c21f5d711b07a86bfff8020 /synapse/crypto/keyring.py | |
parent | Make changelog entry be a feature (diff) | |
parent | Merge pull request #5850 from matrix-org/erikj/retry_well_known_on_fail (diff) | |
download | synapse-1e4b4d85e7f4604d0617bba01b279f3dc2ced1d2.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/reliable_lookups
Diffstat (limited to 'synapse/crypto/keyring.py')
-rw-r--r-- | synapse/crypto/keyring.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index 6c3e885e72..654accc843 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -18,7 +18,6 @@ import logging from collections import defaultdict import six -from six import raise_from from six.moves import urllib import attr @@ -657,9 +656,10 @@ class PerspectivesKeyFetcher(BaseV2KeyFetcher): }, ) except (NotRetryingDestination, RequestSendFailed) as e: - raise_from(KeyLookupError("Failed to connect to remote server"), e) + # these both have str() representations which we can't really improve upon + raise KeyLookupError(str(e)) except HttpResponseException as e: - raise_from(KeyLookupError("Remote server returned an error"), e) + raise KeyLookupError("Remote server returned an error: %s" % (e,)) keys = {} added_keys = [] @@ -821,9 +821,11 @@ class ServerKeyFetcher(BaseV2KeyFetcher): timeout=10000, ) except (NotRetryingDestination, RequestSendFailed) as e: - raise_from(KeyLookupError("Failed to connect to remote server"), e) + # these both have str() representations which we can't really improve + # upon + raise KeyLookupError(str(e)) except HttpResponseException as e: - raise_from(KeyLookupError("Remote server returned an error"), e) + raise KeyLookupError("Remote server returned an error: %s" % (e,)) if response["server_name"] != server_name: raise KeyLookupError( |