From dc62278788ecb31ac07ec4a7d73f07ff3d4684c8 Mon Sep 17 00:00:00 2001 From: Niklas Ye Date: Thu, 8 Oct 2026 08:58:19 +0200 Subject: [PATCH] Check rows.Err() after the timeline scan loop (#27) --- internal/api/incidents.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/api/incidents.go b/internal/api/incidents.go index b7b6c5e..a1576d5 100644 --- a/internal/api/incidents.go +++ b/internal/api/incidents.go @@ -189,6 +189,10 @@ func handleIncidentTimeline(db *sql.DB) http.HandlerFunc { e.CreatedAt = time.Unix(ts, 0).UTC() events = append(events, e) } + if err := rows.Err(); err != nil { + respond(w, http.StatusInternalServerError, errResp("internal error")) + return + } respond(w, http.StatusOK, events) } }