Add AfterInitialize error

This commit is contained in:
Jinzhu 2021-03-29 18:36:01 +08:00
parent 0eba7a9ed1
commit 73c6d3e64e
1 changed files with 3 additions and 1 deletions

View File

@ -117,7 +117,9 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) {
return nil, err
}
defer func(opt Option) {
opt.AfterInitialize(db)
if errr := opt.AfterInitialize(db); errr != nil {
err = errr
}
}(opt)
}
}