vim-gnupg icon indicating copy to clipboard operation
vim-gnupg copied to clipboard

Better error reporting of GPG failures

Open repli2dev opened this issue 8 years ago • 2 comments

I run into strange situation when my gpg via terminal worked (exactly the same command copied from the log) however the plugin failed to loaded with "Message could not be decrypted! (Press ENTER)".

The problem was in that the gpg worked but returned code 2 as it encounered on malformed GPG_AGENT_INFO variable and it would be really nice if I haven't spent two hours of gun-shot debugging to find this :-)

repli2dev avatar Jun 26 '16 12:06 repli2dev

Suggestions welcome. I don't think there's much information from gpg in such a situation (but don't have an environment to check right now).

jamessan avatar Jun 30 '16 14:06 jamessan

Thanks for reply :-) In my situation changing the message "Message could not be encrypted! (Press ENTER)" to something like "Message could not be encrypted as gpg command exited with non zero code! (Press ENTER)" would be much more helpful.

Another idea would be to capture the error output and in show it in the case of failure (such as this). But that would be probably overkill as the first suggested approach seems to convey the main message where to look.

repli2dev avatar Jul 02 '16 15:07 repli2dev