aboutsummaryrefslogtreecommitdiffstats
path: root/entities/identity
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-11-27 20:51:37 -0500
committerSteve Moyer <smoyer1@selesy.com>2022-11-27 20:51:37 -0500
commit64c18b15a4a0c8b7e59587aa09de92d52c698ede (patch)
tree8738e651e57c3cf7a21ae76e9733206ccea7a6b9 /entities/identity
parentc6bb6b9c7ecddb679966b1561e2e909a9ee5e8cd (diff)
downloadgit-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.go4
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 {