Don't show error logs on closed transaction rollback
This commit is contained in:
parent
85fd1d081d
commit
9be95763e2
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue