diff options
author | dwight <dwight@Dwights-MacBook-2.local> | 2009-02-08 16:02:48 -0500 |
---|---|---|
committer | dwight <dwight@Dwights-MacBook-2.local> | 2009-02-08 16:02:48 -0500 |
commit | d45688ce1d0440c4b40bcf51e98f5338d15b4a9d (patch) | |
tree | 71c15cc2bd1d7dd3233391077034ba5e32290322 | |
parent | 7892e1771526827ba2d447e111eab181c11da5fc (diff) | |
download | mongo-d45688ce1d0440c4b40bcf51e98f5338d15b4a9d.tar.gz |
fix thorwing of exception wasn't right (dbclientconnection)
-rw-r--r-- | client/dbclient.h | 2 | ||||
-rw-r--r-- | client/examples/tutorial.cpp | 8 | ||||
-rw-r--r-- | db/db.sln | 11 |
3 files changed, 17 insertions, 4 deletions
diff --git a/client/dbclient.h b/client/dbclient.h index a2efbbb674f..33d9e41a469 100644 --- a/client/dbclient.h +++ b/client/dbclient.h @@ -566,7 +566,7 @@ namespace mongo { void connect(string serverHostname) { string errmsg; if( !connect(serverHostname.c_str(), errmsg) ) - throw new ConnectException(string("can't connect ") + errmsg); + throw ConnectException(string("can't connect ") + errmsg); } virtual bool auth(const char *dbname, const char *username, const char *pwd, string& errmsg, bool digestPassword = true); diff --git a/client/examples/tutorial.cpp b/client/examples/tutorial.cpp index 801c890dd00..e545632a20a 100644 --- a/client/examples/tutorial.cpp +++ b/client/examples/tutorial.cpp @@ -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; diff --git a/db/db.sln b/db/db.sln index 5b6e2cdaaab..4eba708344e 100644 --- a/db/db.sln +++ b/db/db.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "clienttests", "clienttests" ..\client\gridfs.cpp = ..\client\gridfs.cpp
..\client\gridfs.h = ..\client\gridfs.h
..\client\examples\second.cpp = ..\client\examples\second.cpp
+ ..\client\examples\tutorial.cpp = ..\client\examples\tutorial.cpp
..\client\examples\whereExample.cpp = ..\client\examples\whereExample.cpp
EndProjectSection
EndProject
@@ -26,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dbtests", "dbtests", "{C72E ..\dbtests\socktests.cpp = ..\dbtests\socktests.cpp
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tutorial", "..\client\examples\tutorial\tutorial.vcproj", "{C5EC52B2-1E28-4AF1-A244-CBB514C361C0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Recstore|Win32 = Debug Recstore|Win32
@@ -49,6 +52,14 @@ Global {E03717ED-69B4-4D21-BC55-DF6690B585C6}.release_nojni|Win32.Build.0 = Debug|Win32
{E03717ED-69B4-4D21-BC55-DF6690B585C6}.Release|Win32.ActiveCfg = Release|Win32
{E03717ED-69B4-4D21-BC55-DF6690B585C6}.Release|Win32.Build.0 = Release|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Debug Recstore|Win32.ActiveCfg = Debug|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Debug Recstore|Win32.Build.0 = Debug|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Debug|Win32.Build.0 = Debug|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.release_nojni|Win32.ActiveCfg = Release|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.release_nojni|Win32.Build.0 = Release|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Release|Win32.ActiveCfg = Release|Win32
+ {C5EC52B2-1E28-4AF1-A244-CBB514C361C0}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
|