diff options
author | Ruben Pollan <meskio@sindominio.net> | 2015-09-22 16:18:36 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2015-09-22 17:42:13 +0200 |
commit | f94e3aff14295821d28be0dbf3f4b40df980271c (patch) | |
tree | 17864ccacc15e1242ab8db59737ef4774b7242ec /keymanager/src/leap | |
parent | d5564316c37c4402b3eabb370b4bf27da3c75463 (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 'keymanager/src/leap')
-rw-r--r-- | keymanager/src/leap/keymanager/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py index 5248cb0f..e378c91f 100644 --- a/keymanager/src/leap/keymanager/__init__.py +++ b/keymanager/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)) |