mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 15:37:32 +00:00
fix: proper error message when user (and other objects) not found (#337)
* fix: proper error message when user not found by loginname * add more not found and fix some typos
This commit is contained in:
@@ -39,6 +39,9 @@ func UserByLoginName(db *gorm.DB, table, loginName string) (*model.UserView, err
|
||||
}
|
||||
query := repository.PrepareGetByQuery(table, loginNameQuery)
|
||||
err := query(db, user)
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-AD4qs", "Errors.User.NotFound")
|
||||
}
|
||||
return user, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user