Handle children db's Error in callbacks

This commit is contained in:
Jinzhu 2015-08-07 16:35:48 +08:00
parent 17917d49d8
commit ab1832b9a5
1 changed files with 3 additions and 1 deletions

View File

@ -205,7 +205,9 @@ func (scope *Scope) CallMethod(name string, checkError bool) {
case func(s *Scope):
f(scope)
case func(s *DB):
f(scope.NewDB())
newDB := scope.NewDB()
f(newDB)
scope.Err(newDB.Error)
case func() error:
scope.Err(f())
case func(s *Scope) error: