From cac8b9d14cb9bb1acee780687a5ba4a946780732 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 11 Jun 2018 13:36:32 +0100 Subject: [PATCH] Appease the errcheck gods --- .../appservice/storage/appservice_events_table.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go b/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go index 58d21873..53864b9d 100644 --- a/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go +++ b/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go @@ -20,6 +20,7 @@ import ( "time" "github.com/matrix-org/gomatrixserverlib" + log "github.com/sirupsen/logrus" ) const appserviceEventsSchema = ` @@ -106,7 +107,13 @@ func (s *eventsStatements) selectEventsByApplicationServiceID( if err != nil { return nil, nil, err } - defer eventRows.Close() // nolint: errcheck + defer func() { + err = eventRows.Close() + if err != nil { + log.WithError(err).Fatalf("Appservice %s unable to select new events to send", + applicationServiceID) + } + }() // Iterate through each row and store event contents for eventRows.Next() {