forked from mirror/gorm
Merge pull request #559 from jaytaylor/jay/uncover-rows-affected-errors
Surface errors emitted by `RowsAffected'.
This commit is contained in:
commit
5663048f13
2
scope.go
2
scope.go
|
@ -300,7 +300,7 @@ func (scope *Scope) Exec() *Scope {
|
|||
|
||||
if !scope.HasError() {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue