fix: a crash when the user provides a connection string there is no running server for is fixed

This commit is contained in:
Sale Djenic 2023-08-23 11:22:32 +02:00 committed by saledjenic
parent b297cf0ae2
commit 13931817dd
1 changed files with 5 additions and 1 deletions

View File

@ -55,7 +55,11 @@ func NewBaseClient(c *ConnectionParams) (*BaseClient, error) {
serverCert, err = getServerCert(u)
if err != nil {
certErrs = fmt.Errorf("%sconnecting to '%s' failed: %s; ", certErrs.Error(), u, err.Error())
var certErr string
if certErrs != nil {
certErr = certErrs.Error()
}
certErrs = fmt.Errorf("%sconnecting to '%s' failed: %s; ", certErr, u, err.Error())
continue
}