-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.0.1
-
Component/s: Implementation
-
None
Uncatchable Error during initialisation. try
{ . . . }catch(...){ . . . }If I input wrong input parameters like: "mongodb://:@:/" The my program exits with -1. Last output is: src/mongoc/mongoc-topology.c:155 mongoc_topology_new(): precondition failed: uri
If the version of the new c++ driver is important, pleas tell me how I can find out the library version of my compiled libraries.
CODE:
mongocxx::client conn; // defined in class header file
SomeClass::someClass(){
std::stringstream stmMongoDbUri;
stmMongoDbUri
<< "mongodb://" //<< MyConfiguration.dbUser
<< ":" //<< MyConfiguration.dbPassword
<< "@" //<< MyConfiguration.dbHost
<< ":" //<< MyConfiguration.dbPort
<< "/" //<< MyConfiguration.databaseName;
std::string strMongoDbUri (std::istreambuf_iterator<char>(stmMongoDbUri), {});
printf("47 - Streamconten Mongo DB Config > %s <", strMongoDbUri.c_str() );
// src/mongoc/mongoc-topology.c:155 mongoc_topology_new(): precondition failed: uri
// No valid connection established / invalid string... ka...
//[strMongoDbUri] = "mongodb://:@:/"
conn = mongocxx::client(mongocxx::uri(strMongoDbUri));
...
}