Check rows.Err() in the remaining Next() loops (#27)

Incident list, the three stats breakdowns and the user list could return a
truncated result as if complete when the scan failed partway.
This commit is contained in:
Niklas Ye
2026-10-08 09:00:54 +02:00
parent dc62278788
commit 3613fd5732
3 changed files with 20 additions and 0 deletions
+4
View File
@@ -116,6 +116,10 @@ func handleListUsers(db *sql.DB) http.HandlerFunc {
u.DisabledAt = unixPtr(disabled)
users = append(users, u)
}
if err := rows.Err(); err != nil {
respond(w, http.StatusInternalServerError, errResp("internal error"))
return
}
respond(w, http.StatusOK, users)
}
}