Skip to content

Commit

Permalink
Merge pull request #113 from georgijd-form3/patch-1
Browse files Browse the repository at this point in the history
Return ErrKeyNotFound when removing missing keychain items
  • Loading branch information
mtibben authored Dec 19, 2022
2 parents e63f6a1 + f78ca73 commit 1022759
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ func (k *keychain) Remove(key string) error {
}

debugf("Removing keychain item service=%q, account=%q, keychain %q", k.service, key, k.path)
return gokeychain.DeleteItem(item)
err := gokeychain.DeleteItem(item)
if err == gokeychain.ErrorItemNotFound {
return ErrKeyNotFound
}

return err

}

func (k *keychain) Keys() ([]string, error) {
Expand Down

0 comments on commit 1022759

Please sign in to comment.