MM-55450: Handle error in db migrate phase (#25430)

We were not handling the error from initConnection.

https://mattermost.atlassian.net/browse/MM-55450
```release-note
NONE
```
This commit is contained in:
Agniva De Sarker 2023-11-15 09:50:20 +05:30 committed by GitHub
parent fee6606606
commit 864046f782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,10 @@ func NewMigrator(settings model.SqlSettings, dryRun bool) (*Migrator, error) {
wgMonitor: &sync.WaitGroup{},
}
ss.initConnection()
err := ss.initConnection()
if err != nil {
return nil, fmt.Errorf("error in initializing connection: %w", err)
}
ver, err := ss.GetDbVersion(true)
if err != nil {