summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/__init__.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2015-09-22 16:18:36 +0200
committerRuben Pollan <meskio@sindominio.net>2015-09-22 17:42:13 +0200
commit1b805754f1d6efe9af25dcf0ab60b3aa2100ee20 (patch)
treeb36fc846da3620bc9d87770a8c2a330d5353c8b1 /src/leap/keymanager/__init__.py
parent6d823d4e94e70d19a31894f973754ff05d557493 (diff)
[bug] catch request exceptions
On fetch_key we were not catching the request exceptions, now they are returned as failure in the deferred as it should. - Related: #7410
Diffstat (limited to 'src/leap/keymanager/__init__.py')
-rw-r--r--src/leap/keymanager/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index 5248cb0f..e378c91f 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -820,7 +820,11 @@ class KeyManager(object):
self._assert_supported_key_type(ktype)
logger.info("Fetch key for %s from %s" % (address, uri))
- res = self._get_with_combined_ca_bundle(uri)
+ try:
+ res = self._get_with_combined_ca_bundle(uri)
+ except Exception as e:
+ logger.warning("There was a problem fetching key: %s" % (e,))
+ return defer.fail(KeyNotFound(uri))
if not res.ok:
return defer.fail(KeyNotFound(uri))