summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-01-16 14:37:42 -0500
committerEric Milkie <milkie@10gen.com>2012-01-24 09:16:42 -0500
commit078c791acd376d60c770c444b3fcd2f5a006baa1 (patch)
tree174792a6c7b6089629c600a9feb47ee5a6ef23c3
parent41a6f84004c8f199215cbc193afc469a1b363494 (diff)
downloadmongo-078c791acd376d60c770c444b3fcd2f5a006baa1.tar.gz
SERVER-3763 SERVER-4643 avoid exceptions in getlasterror due to other shards being down
I had to move the creation of ShardConnection inside the try/catch because it is possible that it might throw a SocketException if the shard is down. This change allows shard_gle_insert.js to pass on Windows, and may alleviate Linux failures with getLastError as well.
-rw-r--r--s/client.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/s/client.cpp b/s/client.cpp
index 9058b319895..8c6983f77df 100644
--- a/s/client.cpp
+++ b/s/client.cpp
@@ -171,9 +171,8 @@ namespace mongo {
if ( temp == theShard )
continue;
- ShardConnection conn( temp , "" );
-
try {
+ ShardConnection conn( temp , "" );
_addWriteBack( writebacks , conn->getLastErrorDetailed() );
}
catch( std::exception &e ){