Merge pull request #559 from jaytaylor/jay/uncover-rows-affected-errors

Surface errors emitted by `RowsAffected'.
This commit is contained in:
Jinzhu 2015-07-03 10:57:19 +08:00
commit 5663048f13
1 changed files with 1 additions and 1 deletions

View File

@ -300,7 +300,7 @@ func (scope *Scope) Exec() *Scope {
if !scope.HasError() { if !scope.HasError() {
if result, err := scope.SqlDB().Exec(scope.Sql, scope.SqlVars...); scope.Err(err) == nil { if result, err := scope.SqlDB().Exec(scope.Sql, scope.SqlVars...); scope.Err(err) == nil {
if count, err := result.RowsAffected(); err == nil { if count, err := result.RowsAffected(); scope.Err(err) == nil {
scope.db.RowsAffected = count scope.db.RowsAffected = count
} }
} }