Skip to content
Snippets Groups Projects
Commit f70c84ce authored by Fabian Seidl's avatar Fabian Seidl
Browse files

changed ID in error to any and name to string

parent 8648b5f8
No related branches found
No related tags found
1 merge request!332Resolve "There are two defined errors (ErrNotFound and ErrCouldNotFind) which represent the same issue"
Pipeline #104865 passed
This commit is part of merge request !332. Comments created here will be created in the context of that merge request.
......@@ -182,12 +182,12 @@ func (e ErrCouldNotUpdate) Error() string {
// ErrCouldNotFind implements the Error interface and is called if a
// stored item can not be found.
type ErrCouldNotFind struct {
ID interface{}
Name interface{}
ID any
Name string
}
func (e ErrCouldNotFind) Error() string {
return fmt.Sprintf("ID: %v or Name: %vnot found", e.ID, e.Name)
return fmt.Sprintf("ID: %v or Name: %v not found", e.ID, e.Name)
}
// ErrCouldNotCreate implements the Error interface and is called if a
......
......@@ -105,7 +105,7 @@ func (s *FileSystemRoleStore) Delete(RoleToDelete rbac.Role) error {
}
}
return &errors.ErrCouldNotFind{ID: RoleToDelete.ID, Name: RoleToDelete.Name()}
return &errors.ErrCouldNotFind{ID: RoleToDelete.ID(), Name: RoleToDelete.Name()}
}
//Get takes a Roles ID and return the Role if found
......
......@@ -105,7 +105,7 @@ func (s *FileSystemUserStore) Delete(userToDelete rbac.User) error {
}
}
return &errors.ErrCouldNotFind{ID: userToDelete.ID, Name: userToDelete.Name()}
return &errors.ErrCouldNotFind{ID: userToDelete.ID(), Name: userToDelete.Name()}
}
//Get takes a Users ID and return the User if found
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment