Skip to content

Commit

Permalink
errors.Wrap for NewGCM
Browse files Browse the repository at this point in the history
  • Loading branch information
molon committed Sep 25, 2024
1 parent 8dacd17 commit ffdb230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cursor/gcm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func decryptGCM(gcm cipher.AEAD, cipherText string) (string, error) {
func NewGCM(key []byte) (cipher.AEAD, error) {
block, err := aes.NewCipher(key)
if err != nil {
return nil, errors.New("could not create cipher block")
return nil, errors.Wrap(err, "could not create cipher")
}

gcm, err := cipher.NewGCM(block)
if err != nil {
return nil, errors.New("could not create GCM")
return nil, errors.Wrap(err, "could not create AEAD")
}
return gcm, nil
}
Expand Down

0 comments on commit ffdb230

Please sign in to comment.