mirror of https://github.com/status-im/migrate.git
postgres: Preserve Unlock error when outer err isn't nil
This commit is contained in:
parent
15713e64cb
commit
09a1959309
|
@ -340,6 +340,8 @@ func (p *Postgres) ensureVersionTable() (err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if e := p.Unlock(); err == nil {
|
if e := p.Unlock(); err == nil {
|
||||||
err = e
|
err = e
|
||||||
|
} else if e != nil {
|
||||||
|
err = &database.Error{OrigErr: err, Err: e.Error()}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue