mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Log errors from rows.Close (#920)
* Log errors from rows.Close * fixed imports * Added contextual messages * fixed review changes
This commit is contained in:
parent
c2bd0b97b3
commit
c019ad7086
43 changed files with 118 additions and 69 deletions
|
@ -20,6 +20,8 @@ import (
|
|||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/common"
|
||||
|
||||
"github.com/matrix-org/dendrite/mediaapi/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
@ -144,7 +146,7 @@ func (s *thumbnailStatements) selectThumbnails(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close() // nolint: errcheck
|
||||
defer common.CloseAndLogIfError(ctx, rows, "selectThumbnails: rows.close() failed")
|
||||
|
||||
var thumbnails []*types.ThumbnailMetadata
|
||||
for rows.Next() {
|
||||
|
|
|
@ -20,6 +20,8 @@ import (
|
|||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/common"
|
||||
|
||||
"github.com/matrix-org/dendrite/mediaapi/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
@ -134,7 +136,7 @@ func (s *thumbnailStatements) selectThumbnails(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close() // nolint: errcheck
|
||||
defer common.CloseAndLogIfError(ctx, rows, "selectThumbnails: rows.close() failed")
|
||||
|
||||
var thumbnails []*types.ThumbnailMetadata
|
||||
for rows.Next() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue