Merge pull request #779 from shenli/master

scope: Catch error for db.Commit()
This commit is contained in:
Jinzhu 2016-01-04 17:59:15 +08:00
commit f330da219c
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ func (scope *Scope) CommitOrRollback() *Scope {
if scope.HasError() {
db.Rollback()
} else {
db.Commit()
scope.Err(db.Commit())
}
scope.db.db = scope.db.parent.db
}