aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/gpg/gpgbin/encrypt.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/gpg/gpgbin/encrypt.go')
-rw-r--r--lib/crypto/gpg/gpgbin/encrypt.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/crypto/gpg/gpgbin/encrypt.go b/lib/crypto/gpg/gpgbin/encrypt.go
index 4cbac37b..e72ba148 100644
--- a/lib/crypto/gpg/gpgbin/encrypt.go
+++ b/lib/crypto/gpg/gpgbin/encrypt.go
@@ -2,6 +2,7 @@ package gpgbin
import (
"bytes"
+ "fmt"
"io"
"git.sr.ht/~rjarry/aerc/models"
@@ -27,7 +28,10 @@ func Encrypt(r io.Reader, to []string, from string) ([]byte, error) {
g.cmd.Run()
outRdr := bytes.NewReader(g.stdout.Bytes())
var md models.MessageDetails
- parse(outRdr, &md)
+ err := parse(outRdr, &md)
+ if err != nil {
+ return nil, fmt.Errorf("gpg: failure to encrypt: %v. check public key(s)", err)
+ }
var buf bytes.Buffer
io.Copy(&buf, md.Body)