Skip to content

Commit 8731ce9

Browse files
add: warning log message if bad connection cannot be closed/discarded
1 parent e47ab54 commit 8731ce9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • internal/infrastructure/db/sqlite

internal/infrastructure/db/sqlite/utils.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ func execTx(
177177

178178
tx, err := conn.BeginTx(ctx, nil)
179179
if err != nil {
180-
_ = closeConn(conn, isInterruptError(ctx, err))
180+
closeErr := closeConn(conn, isInterruptError(ctx, err))
181+
log.WithError(closeErr).
182+
Warn("failed to close connection on unsuccessful begin transaction")
181183
return fmt.Errorf("failed to begin transaction: %w", err)
182184
}
183185
qtx := queries.New(conn).WithTx(tx)

0 commit comments

Comments
 (0)