mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Use errors.Is for comparing errors (#26719)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
16c185c3b9
commit
35c67606ce
@ -42,7 +42,7 @@ func (ls *LoginService) UpsertUser(cmd *models.UpsertUserCommand) error {
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(userQuery); err != nil {
|
||||
if err != models.ErrUserNotFound {
|
||||
if !errors.Is(err, models.ErrUserNotFound) {
|
||||
return err
|
||||
}
|
||||
if !cmd.SignupAllowed {
|
||||
@ -114,7 +114,7 @@ func (ls *LoginService) UpsertUser(cmd *models.UpsertUserCommand) error {
|
||||
User: cmd.Result,
|
||||
ExternalUser: extUser,
|
||||
})
|
||||
if err != nil && err != bus.ErrHandlerNotFound {
|
||||
if err != nil && !errors.Is(err, bus.ErrHandlerNotFound) {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -223,7 +223,7 @@ func syncOrgRoles(user *models.User, extUser *models.ExternalUserInfo) error {
|
||||
// add role
|
||||
cmd := &models.AddOrgUserCommand{UserId: user.Id, Role: orgRole, OrgId: orgId}
|
||||
err := bus.Dispatch(cmd)
|
||||
if err != nil && err != models.ErrOrgNotFound {
|
||||
if err != nil && !errors.Is(err, models.ErrOrgNotFound) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user