Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

JAVA-772: If cursor is not found by the server, report in the excepti…

…on the cursor that was requested
  • Loading branch information...
commit 5391df18a8468089fe51fce6cd209c3e7fd5b6c9 1 parent d647ccd
@jyemin jyemin authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/com/mongodb/DBApiLayer.java
View
8 src/main/com/mongodb/DBApiLayer.java
@@ -362,16 +362,16 @@ public void createIndex( final DBObject keys, final DBObject options, DBEncoder
}
private void init( Response res ){
+ if ( ( res._flags & Bytes.RESULTFLAG_CURSORNOTFOUND ) > 0 ){
+ throw new MongoException.CursorNotFound(_curResult.cursor(), res.serverUsed());
+ }
+
_totalBytes += res._len;
_curResult = res;
_cur = res.iterator();
_sizes.add( res.size() );
_numFetched += res.size();
- if ( ( res._flags & Bytes.RESULTFLAG_CURSORNOTFOUND ) > 0 ){
- throw new MongoException.CursorNotFound(res._cursor, res.serverUsed());
- }
-
if (res._cursor != 0 && _limit > 0 && _limit - _numFetched <= 0) {
// fetched all docs within limit, close cursor server-side
killCursor();
Please sign in to comment.
Something went wrong with that request. Please try again.