summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-25 02:01:07 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-25 02:02:37 -0500
commitfd36dc975e8129121ec25db7a5576c4994a288af (patch)
tree0b3525471c9565fe8cc007d48a6f1802d4bc4794
parenta7eb7f2c47f247f6a9632ecd491536c93aa7ef3a (diff)
downloadmongo-fd36dc975e8129121ec25db7a5576c4994a288af.tar.gz
better exception
-rw-r--r--client/connpool.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/connpool.cpp b/client/connpool.cpp
index 8c25ab6fa6e..2bd883850b6 100644
--- a/client/connpool.cpp
+++ b/client/connpool.cpp
@@ -135,7 +135,8 @@ namespace mongo {
uassert( 13071 , (string)"invalid hostname [" + host + "]" + errmsg , cs.isValid() );
c = cs.connect( errmsg );
- uassert( 11002 , _name + ": connect failed " + host + " : " + errmsg , c );
+ if ( ! c )
+ throw SocketException( SocketException::CONNECT_ERROR , host , 11002 , str::stream() << _name << " error: " << errmsg );
return _finishCreate( host , c );
}