return the result on transaction (#1725)
return the result on transaction Reviewed-on: https://gitea.com/xorm/xorm/pulls/1725
This commit is contained in:
parent
cc7d219065
commit
9b41b879a7
|
@ -1263,11 +1263,11 @@ func (engine *Engine) Transaction(f func(*Session) (interface{}, error)) (interf
|
||||||
|
|
||||||
result, err := f(session)
|
result, err := f(session)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := session.Commit(); err != nil {
|
if err := session.Commit(); err != nil {
|
||||||
return nil, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|
Loading…
Reference in New Issue