mirror of https://github.com/go-gorm/gorm.git
DB errors over NotFound
Errors comings from DB have higher priority than logic ones
This commit is contained in:
parent
45ccb13437
commit
1eb3a5ae97
|
@ -80,9 +80,7 @@ func queryCallback(scope *Scope) {
|
||||||
|
|
||||||
if err := rows.Err(); err != nil {
|
if err := rows.Err(); err != nil {
|
||||||
scope.Err(err)
|
scope.Err(err)
|
||||||
}
|
} else if scope.db.RowsAffected == 0 && !isSlice {
|
||||||
|
|
||||||
if scope.db.RowsAffected == 0 && !isSlice {
|
|
||||||
scope.Err(ErrRecordNotFound)
|
scope.Err(ErrRecordNotFound)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue