Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

findOne throws better error

  • Loading branch information...
commit b3b64405f5517c098a3adc8c652706fbf614e3f9 1 parent 1721270
@erh erh authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 client/dbclient.cpp
View
4 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();
Please sign in to comment.
Something went wrong with that request. Please try again.