Permalink
Browse files

findOne throws better error

  • Loading branch information...
1 parent 1721270 commit b3b64405f5517c098a3adc8c652706fbf614e3f9 @erh erh committed Apr 30, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 client/dbclient.cpp
View
@@ -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();

0 comments on commit b3b6440

Please sign in to comment.