nil except

This commit is contained in:
mr 2024-08-01 11:33:27 +02:00
parent 69d53f9d4d
commit c3e6f04dd8

View File

@ -47,9 +47,11 @@ func (m *MongoDB) Init(collections []string, config MongoConf) {
m.Logger.Info().Msg("Connecting to" + config.GetUrl())
mngoCollections = collections
mngoConfig = config
err := m.createClient(config.GetUrl())
m.Logger.Error().Msg(err.Error())
if err := m.createClient(config.GetUrl()); err != nil {
m.Logger.Error().Msg(err.Error())
}
}
func (m *MongoDB) createClient(MongoURL string) error {
var err error
// Allows us to use marshal and unmarshall with results of FindOne() and others