passthrough mongod $err through mognos SERVER-1431

This commit is contained in:
Eliot Horowitz
2010-07-19 10:57:16 -04:00
parent 1d7c6c8b3a
commit dc9de883be
2 changed files with 11 additions and 0 deletions

View File

@@ -72,6 +72,13 @@ namespace mongo {
throw StaleConfigException( _ns , "ClusteredCursor::query" );
}
if ( cursor->hasResultFlag( ResultFlag_ErrSet ) ){
conn.done();
BSONObj o = cursor->next();
throw UserException( o["code"].numberInt() , o["$err"].String() );
}
cursor->attach( &conn );
conn.done();