Merge pull request #534 from grouville/dagger_list_private_key

Dagger List cmd : change error message to a more comprehensible one when privatekey not present
This commit is contained in:
Andrea Luzzardi 2021-06-01 13:23:24 -07:00 committed by GitHub
commit 795c34a300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,6 +131,9 @@ func Decrypt(_ context.Context, encrypted []byte) ([]byte, error) {
}
key, err := tree.Metadata.GetDataKey()
if err != nil {
if userErr, ok := err.(sops.UserError); ok {
err = fmt.Errorf(userErr.UserError())
}
return nil, err
}