catch semi-specific errors only.
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 27 Jul 2015 21:52:55 +0000 (17:52 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:28:41 +0000 (13:28 -0500)
edward

diff --git a/edward b/edward
index 56d3c2516f8738833d40b422b3aafd01c2f820d9..1dad2e1c8062dc2aab55e7c658f9304598c2e838 100755 (executable)
--- 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')