RBAC: Return the underlying error instead of internal server or bad request for managed permission endpoints (#80974)

* return not found instead of an internal server error when listing/updating permissions

* openapi gen
This commit is contained in:
Ieva
2024-01-25 16:24:52 +00:00
committed by GitHub
parent 25dd8d5ceb
commit dc9e590b7b
6 changed files with 61 additions and 7 deletions
+2 -2
View File
@@ -245,7 +245,7 @@ func (ss *sqlStore) GetParents(ctx context.Context, q folder.GetParentsQuery) ([
if len(folders) < 1 {
// the query is expected to return at least the same folder
// if it's empty it means that the folder does not exist
return nil, folder.ErrFolderNotFound
return nil, folder.ErrFolderNotFound.Errorf("folder not found")
}
return util.Reverse(folders[1:]), nil
@@ -308,7 +308,7 @@ func (ss *sqlStore) getParentsMySQL(ctx context.Context, q folder.GetParentsQuer
return err
}
if !ok {
return folder.ErrFolderNotFound
return folder.ErrFolderNotFound.Errorf("folder not found")
}
for {
f := &folder.Folder{}