commit 675718e95dbd31c72a32025a0fd6256dc05271cf
parent b5677a29691bd1bf02c071c83afc5d8c875c65a5
Author: Hamish Downer <dmishd@gmail.com>
Date: Sun, 20 Feb 2011 19:38:39 +0000
change extra error checking to use unified error message code
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
@@ -112,8 +112,8 @@ EOS
# if the key (or gpg-agent) is not available GPGME does not complain
# but just returns a zero length string. Let's catch that
if sig.length == 0
- info "GPG failed to generate signature: check that gpg-agent is running and your key is available."
- raise Error, "GPG command failed. See log for details."
+ raise Error, gpgme_exc_msg("GPG failed to generate signature: check that gpg-agent is running and your key is available.")
+ end
end
envelope = RMail::Message.new
@@ -146,8 +146,7 @@ EOS
# if the key (or gpg-agent) is not available GPGME does not complain
# but just returns a zero length string. Let's catch that
if cipher.length == 0
- info "GPG failed to generate cipher text: check that gpg-agent is running and your key is available."
- raise Error, "GPG command failed. See log for details."
+ raise Error, gpgme_exc_msg("GPG failed to generate cipher text: check that gpg-agent is running and your key is available.")
end
encrypted_payload = RMail::Message.new