error
This commit is contained in:
parent
b0f5c78e55
commit
0256266107
@ -77,18 +77,18 @@ func (m *MongoDB) createClient(MongoURL string) error {
|
||||
mngoClient, err = mongo.Connect(MngoCtx, clientOptions)
|
||||
if err != nil {
|
||||
mngoClient = nil
|
||||
return errors.New("Mongodb NewClient " + MongoURL + ":" + "err")
|
||||
return errors.New("Mongodb NewClient " + MongoURL + ":" + err.Error())
|
||||
}
|
||||
|
||||
// Ping the primary
|
||||
if mngoClient, err = mongo.Connect(MngoCtx, clientOptions); err != nil {
|
||||
mngoClient = nil
|
||||
return errors.New("Mongodb connect " + MongoURL + ":" + "err")
|
||||
return errors.New("Mongodb connect " + MongoURL + ":" + err.Error())
|
||||
}
|
||||
|
||||
if err = mngoClient.Ping(MngoCtx, nil); err != nil {
|
||||
mngoClient = nil
|
||||
return errors.New("Mongodb ping " + MongoURL + ":" + "err")
|
||||
return errors.New("Mongodb ping " + MongoURL + ":" + err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user