Bug #580212 - Report errors in CamelException when verifying signature
authorMilan Crha <mcrha@redhat.com>
Mon, 1 Jun 2009 16:59:40 +0000 (18:59 +0200)
committerMilan Crha <mcrha@redhat.com>
Mon, 1 Jun 2009 16:59:40 +0000 (18:59 +0200)
camel/camel-gpg-context.c

index 951e130..dba2384 100644 (file)
@@ -1559,7 +1559,16 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
                        goto exception;
        }
 
-       gpg_ctx_op_wait (gpg);
+       if (gpg_ctx_op_wait (gpg) != 0) {
+               const gchar *diagnostics;
+
+               diagnostics = gpg_ctx_get_diagnostics (gpg);
+               camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+                                    diagnostics && *diagnostics ? diagnostics :
+                                    _("Failed to execute gpg."));
+               goto exception;
+       }
+
        validity = camel_cipher_validity_new ();
        diagnostics = gpg_ctx_get_diagnostics (gpg);
        camel_cipher_validity_set_description (validity, diagnostics);