Skip to content

Commit 03fda50

Browse files
committed
Added better handling of QueryFailure flag
1 parent 6ddfc01 commit 03fda50

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/mongodb/cursor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ var getMore = function(self, options, callback) {
735735
return callback(utils.toError(err), null);
736736
}
737737

738+
// If the QueryFailure flag is set
739+
if((result.responseFlag & (1 << 1)) != 0) {
740+
self.state = Cursor.CLOSED;
741+
return callback(utils.toError("QueryFailure flag set on getmore command"), null);
742+
}
743+
738744
try {
739745
var isDead = 1 === result.responseFlag && result.cursorId.isZero();
740746

0 commit comments

Comments
 (0)