1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-26 14:04:13 +00:00

complete error log

This commit is contained in:
jianzhiyao 2020-07-20 17:25:27 +08:00
parent 32da446eb1
commit aefe21b63a

View File

@ -558,10 +558,14 @@ func (o *orm) DoTxWithCtxAndOpts(ctx context.Context, opts *sql.TxOptions, task
defer func() { defer func() {
if panicked || err != nil { if panicked || err != nil {
e := _txOrm.Rollback() e := _txOrm.Rollback()
logs.Error("rollback transaction failed: %v", e) if e != nil {
logs.Error("rollback transaction failed: %v,%v", e, panicked)
}
} else { } else {
e := _txOrm.Commit() e := _txOrm.Commit()
logs.Error("commit transaction failed: %v", e) if e != nil {
logs.Error("commit transaction failed: %v,%v", e, panicked)
}
} }
}() }()