Folders: Fix folder parents error handling (#109605)

This commit is contained in:
Tom Ratcliffe 2025-09-02 14:25:28 +01:00 committed by GitHub
parent 9816c48ab2
commit 2a5ba2e74a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -58,14 +58,17 @@ func (r *subParentsREST) Connect(ctx context.Context, name string, opts runtime.
obj, err := r.getter.Get(ctx, name, &metav1.GetOptions{})
if storage.IsNotFound(err) {
responder.Object(http.StatusNotFound, nil)
return
}
if err != nil {
responder.Error(err)
return
}
folderObj, ok := obj.(*folders.Folder)
if !ok {
responder.Error(fmt.Errorf("expecting folder, found: %T", folderObj))
return
}
info := r.parents(ctx, folderObj)