fix thorwing of exception wasn't right (dbclientconnection)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <iostream>
|
||||
#include "client/dbclient.h"
|
||||
#include "../../client/dbclient.h"
|
||||
|
||||
// g++ -I ../.. -L ../.. tutorial.cpp -lmongoclient -lboost_thread -lboost_filesystem
|
||||
|
||||
@@ -7,13 +7,15 @@ using namespace mongo;
|
||||
|
||||
void run() {
|
||||
DBClientConnection c;
|
||||
|
||||
c.connect("localhost");
|
||||
cout << "connected ok" << endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
try {
|
||||
run();
|
||||
} catch( DBException &e ) {
|
||||
}
|
||||
catch( DBException &e ) {
|
||||
cout << "caught " << e.what() << endl;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user