forked from molecule-ai/molecule-core
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:
commit
bc9cf599da
@ -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{}{}
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user