fix: improve api error handling for dashboards and folders (#111831)

This commit is contained in:
Mustafa Sencer Özcan
2025-10-01 09:54:14 +02:00
committed by GitHub
parent b7bdc98479
commit aeb62b7acc
9 changed files with 214 additions and 28 deletions
+2 -2
View File
@@ -1401,13 +1401,13 @@ func (s *Service) validateParent(ctx context.Context, orgID int64, parentUID str
// Create folder under itself is not allowed
if parentUID == UID {
return folder.ErrCircularReference
return folder.ErrCircularReference.Errorf("circular reference detected")
}
// check there is no circular reference
for _, ancestor := range ancestors {
if ancestor.UID == UID {
return folder.ErrCircularReference
return folder.ErrCircularReference.Errorf("circular reference detected")
}
}