Merge pull request 'fix(handlers): add rows.Err() checks after rows.Next() loops' (#412) from fix/delegations-rows-err-check into main

This commit is contained in:
Molecule AI · core-be 2026-05-11 06:54:27 +00:00
commit bc9cf599da
2 changed files with 7 additions and 0 deletions

View File

@ -645,6 +645,9 @@ func (h *DelegationHandler) ListDelegations(c *gin.Context) {
}
delegations = append(delegations, entry)
}
if err := rows.Err(); err != nil {
log.Printf("ListDelegations rows.Err: %v", err)
}
if delegations == nil {
delegations = []map[string]interface{}{}

View File

@ -800,6 +800,10 @@ func (h *OrgHandler) Import(c *gin.Context) {
orphanIDs = append(orphanIDs, orphanID)
}
}
if err := rows.Err(); err != nil {
log.Printf("Org import reconcile: orphan query rows.Err: %v", err)
reconcileErrs = append(reconcileErrs, fmt.Sprintf("orphan query rows.Err: %v", err))
}
rows.Close()
for _, oid := range orphanIDs {