summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2015-02-19 10:21:56 -0600
committerRuben Pollan <meskio@sindominio.net>2015-02-19 10:40:47 -0600
commitc4bcdea3621ad52400047170e3b7c8049755f629 (patch)
treeac8e54b1153104c533dd1b8b7f382895dc3faf28
parent8d8d5f2a3d9dbefcf98a5e3d7245a5f13360a88e (diff)
Fetch keys should return KeyNotFound for unknown errors
-rw-r--r--changes/bug-4752_error_fetching_keys1
-rw-r--r--src/leap/keymanager/__init__.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changes/bug-4752_error_fetching_keys b/changes/bug-4752_error_fetching_keys
new file mode 100644
index 00000000..04bf1af7
--- /dev/null
+++ b/changes/bug-4752_error_fetching_keys
@@ -0,0 +1 @@
+- Return always KeyNotFound failure if fetch keys fails on an unknown error
diff --git a/src/leap/keymanager/__init__.py b/src/leap/keymanager/__init__.py
index a1a59f54..3ef63505 100644
--- a/src/leap/keymanager/__init__.py
+++ b/src/leap/keymanager/__init__.py
@@ -230,11 +230,11 @@ class KeyManager(object):
if e.response.status_code == 404:
d = defer.fail(KeyNotFound(address))
else:
- d = defer.fail(e)
+ d = defer.fail(KeyNotFound(e.message))
logger.warning("HTTP error retrieving key: %r" % (e,))
logger.warning("%s" % (res.content,))
except Exception as e:
- d = defer.fail(e)
+ d = defer.fail(KeyNotFound(e.message))
logger.warning("Error retrieving key: %r" % (e,))
return d