~sircmpwn/core-go

7f5f70710c33c1ad3609ff5a36e62cf308888260 — Simon Ser 8 months ago cfae7ba
database/middleware: fix error value used in panic

We were checking txErr, but panic'ing with err.

Fixes: a06a6247898c ("database: don't panic with ErrBadConn")
1 files changed, 1 insertions(+), 1 deletions(-)

M database/middleware.go
M database/middleware.go => database/middleware.go +1 -1
@@ 69,7 69,7 @@ func WithTx(ctx context.Context, opts *sql.TxOptions, fn func(tx *sql.Tx) error)
		return err
	}
	if txErr != nil && txErr != sql.ErrTxDone {
		panic(err)
		panic(txErr)
	}
	return err
}