Handle children db's Error in callbacks

This commit is contained in:
Jinzhu 2015-08-07 16:35:48 +08:00
parent d21eed4b66
commit fd9e42655f
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: