mirror of https://github.com/go-gorm/gorm.git
Handle children db's Error in callbacks
This commit is contained in:
parent
d21eed4b66
commit
fd9e42655f
4
scope.go
4
scope.go
|
@ -205,7 +205,9 @@ func (scope *Scope) CallMethod(name string, checkError bool) {
|
||||||
case func(s *Scope):
|
case func(s *Scope):
|
||||||
f(scope)
|
f(scope)
|
||||||
case func(s *DB):
|
case func(s *DB):
|
||||||
f(scope.NewDB())
|
newDB := scope.NewDB()
|
||||||
|
f(newDB)
|
||||||
|
scope.Err(newDB.Error)
|
||||||
case func() error:
|
case func() error:
|
||||||
scope.Err(f())
|
scope.Err(f())
|
||||||
case func(s *Scope) error:
|
case func(s *Scope) error:
|
||||||
|
|
Loading…
Reference in New Issue