diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-04-29 21:45:58 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-04-29 21:45:58 -0400 |
commit | b3b64405f5517c098a3adc8c652706fbf614e3f9 (patch) | |
tree | 8204709f6b9f5b08b9dce10fe4620832068bd862 /client | |
parent | 1721270c5b43e9bb1e7fb6bfdd201c9e38ad3695 (diff) | |
download | mongo-b3b64405f5517c098a3adc8c652706fbf614e3f9.tar.gz |
findOne throws better error
Diffstat (limited to 'client')
-rw-r--r-- | client/dbclient.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp index d7ff9cb1d82..5394e65ef7f 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -26,6 +26,7 @@ #include "../db/dbmessage.h" #include "../db/cmdline.h" #include "connpool.h" +#include "../s/util.h" namespace mongo { @@ -443,6 +444,9 @@ namespace mongo { uassert( 10276 , "DBClientBase::findOne: transport error", c.get() ); + if ( c->hasResultFlag( QueryResult::ResultFlag_ShardConfigStale ) ) + throw StaleConfigException( ns , "findOne has stale config" ); + if ( !c->more() ) return BSONObj(); |