summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-03-11 17:12:20 +0000
committerGitHub <noreply@github.com>2019-03-11 17:12:20 +0000
commit9c0e6e8e7c52922fa4e892e2f396599459d4c416 (patch)
tree84333f042b8f2bc195480bc651b6b562bca37958
parentMerge pull request #4839 from matrix-org/anoa/no_captcha_tests (diff)
parentNewsfile (diff)
downloadsynapse-9c0e6e8e7c52922fa4e892e2f396599459d4c416.tar.xz
Merge pull request #4847 from matrix-org/erikj/fix_stacktrace_keyring
Correctly log expected errors when fetching server keys
-rw-r--r--changelog.d/4847.misc1
-rw-r--r--synapse/crypto/keyring.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/4847.misc b/changelog.d/4847.misc
new file mode 100644
index 0000000000..a001238e08
--- /dev/null
+++ b/changelog.d/4847.misc
@@ -0,0 +1 @@
+Correctly log expected errors when fetching server keys.
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py
index 7474fd515f..0207cd989a 100644
--- a/synapse/crypto/keyring.py
+++ b/synapse/crypto/keyring.py
@@ -686,9 +686,9 @@ def _handle_key_deferred(verify_request):
     try:
         with PreserveLoggingContext():
             _, key_id, verify_key = yield verify_request.deferred
-    except (IOError, RequestSendFailed) as e:
+    except KeyLookupError as e:
         logger.warn(
-            "Got IOError when downloading keys for %s: %s %s",
+            "Failed to download keys for %s: %s %s",
             server_name, type(e).__name__, str(e),
         )
         raise SynapseError(