Don't show error logs on closed transaction rollback

This commit is contained in:
Eli Ribble 2026-05-11 23:29:35 +00:00
parent 85fd1d081d
commit 9be95763e2
No known key found for this signature in database

View file

@ -29,7 +29,7 @@ func LogOnErrRollback(f ErrorableCtx, ctx context.Context, msg string) {
e := f(ctx) e := f(ctx)
if e != nil { if e != nil {
// We're fine with rollbacks that are already properly closed // We're fine with rollbacks that are already properly closed
if e.Error() == "sql: transaction has already been committed or rolled back" { if e.Error() == "sql: transaction has already been committed or rolled back" || e.Error() == "tx is closed" {
return return
} }
log.Error().Err(e).Msg(msg) log.Error().Err(e).Msg(msg)