From edf87f1ea8d3a3a76235649b852f9486ddd76726 Mon Sep 17 00:00:00 2001 From: Johannes Kulick Date: Tue, 18 Dec 2012 11:30:08 +0100 Subject: better error messages also the error catchings are mostly moved to crypto.py whcih makes everything else a little bit cleaner --- alot/crypto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alot/crypto.py') diff --git a/alot/crypto.py b/alot/crypto.py index 9000d15b..97449c78 100644 --- a/alot/crypto.py +++ b/alot/crypto.py @@ -122,9 +122,10 @@ def get_key(keyid): except gpgme.GpgmeError as e: if e.code == gpgme.ERR_AMBIGUOUS_NAME: # Deferred import to avoid a circular import dependency - from alot.db.errors import GPGProblem raise GPGProblem(("More than one key found matching this filter." " Please be more specific (use a key ID like 4AC8EE1D).")) + elif e.code == gpgme.ERR_INV_VALUE or e.code == gpgme.ERR_EOF: + raise GPGProblem("Can not find key for " + keyid) else: raise e return key -- cgit v1.2.3