diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-11-27 20:51:37 -0500 |
---|---|---|
committer | Steve Moyer <smoyer1@selesy.com> | 2022-11-27 20:51:37 -0500 |
commit | 64c18b15a4a0c8b7e59587aa09de92d52c698ede (patch) | |
tree | 8738e651e57c3cf7a21ae76e9733206ccea7a6b9 /entities/identity | |
parent | c6bb6b9c7ecddb679966b1561e2e909a9ee5e8cd (diff) | |
download | git-bug-64c18b15a4a0c8b7e59587aa09de92d52c698ede.tar.gz |
feat: wrap ErrNoConfigEntry to report missing key
Resolves #935.
Diffstat (limited to 'entities/identity')
-rw-r--r-- | entities/identity/identity_user.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/entities/identity/identity_user.go b/entities/identity/identity_user.go index cd67459e..435af060 100644 --- a/entities/identity/identity_user.go +++ b/entities/identity/identity_user.go @@ -36,7 +36,7 @@ func GetUserIdentity(repo repository.Repo) (*Identity, error) { func GetUserIdentityId(repo repository.Repo) (entity.Id, error) { val, err := repo.LocalConfig().ReadString(identityConfigKey) - if err == repository.ErrNoConfigEntry { + if errors.Is(err, repository.ErrNoConfigEntry) { return entity.UnsetId, ErrNoIdentitySet } if err == repository.ErrMultipleConfigEntry { @@ -58,7 +58,7 @@ func GetUserIdentityId(repo repository.Repo) (entity.Id, error) { // IsUserIdentitySet say if the user has set his identity func IsUserIdentitySet(repo repository.Repo) (bool, error) { _, err := repo.LocalConfig().ReadString(identityConfigKey) - if err == repository.ErrNoConfigEntry { + if errors.Is(err, repository.ErrNoConfigEntry) { return false, nil } if err != nil { |