Decryption with the python module around gpgme only produces very general error codes which give little or no clue to what happened.
I did 3 different tests:
- Decrypt and cancel the passphrase dialog of the agent
- Decrypt data for which you do not have the private key
- Decrypt truncated/corrupt data
All 3 returned a GPGMEError exception with text "Invocation of gpgme_op_decrypt_verify: GPGME: Decryption failed" and error code 152.
This is not really helpful as the three cases above should be handled differently - first one is no error, second one should show a meaningful message and only the third one really is an error.