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:
@@ -1,6 +1,7 @@
|
||||
package view
|
||||
|
||||
import (
|
||||
caos_errs "github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/internal/view/repository"
|
||||
"github.com/jinzhu/gorm"
|
||||
|
||||
@@ -23,6 +24,9 @@ func UserSessionByIDs(db *gorm.DB, table, agentID, userID string) (*model.UserSe
|
||||
}
|
||||
query := repository.PrepareGetByQuery(table, userAgentQuery, userQuery)
|
||||
err := query(db, userSession)
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-NGBs1", "Errors.UserSession.NotFound")
|
||||
}
|
||||
return userSession, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user