From: Andrew Engelbrecht Date: Mon, 27 Jul 2015 21:52:55 +0000 (-0400) Subject: catch semi-specific errors only. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5f6f32b11c20b921edf97a47d212e9cc4b7011c2;p=edward.git catch semi-specific errors only. --- diff --git a/edward b/edward index 56d3c25..1dad2e1 100755 --- a/edward +++ b/edward @@ -282,7 +282,7 @@ def get_gpg_context (gnupghome, sign_with_key_fp): try: sign_with_key = gpgme_ctx.get_key(sign_with_key_fp) - except: + except gpgme.GpgmeError: error("unable to load signing key. is the gnupghome " + "and signing key properly set in the edward_config.py?") exit(1) @@ -855,7 +855,7 @@ def get_key_from_fp (replyinfo_obj, gpgme_ctx): encrypt_to_key = gpgme_ctx.get_key(replyinfo_obj.target_key) return encrypt_to_key - except: + except gpgme.GpgmeError: pass # no available key to use @@ -978,7 +978,7 @@ def verify_sig_message (msg_block, gpgme_ctx): try: sigs = gpgme_ctx.verify(block_b, None, plain_b) - except: + except gpgme.GpgmeError: return ("",[]) plaintext = plain_b.getvalue().decode('utf-8') @@ -1038,7 +1038,7 @@ def decrypt_block (msg_block, gpgme_ctx): try: sigs = gpgme_ctx.decrypt_verify(block_b, plain_b) - except: + except gpgme.GpgmeError: return ("",[]) plaintext = plain_b.getvalue().decode('utf-8')