Skip to content

Commit 9168bbc

Browse files
committed
doc: update comment on interrupted error check
1 parent 76ae6c8 commit 9168bbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cursor/abstract_cursor.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,9 @@ function makeCursorStream<TSchema extends Document>(cursor: AbstractCursor<TSche
851851

852852
// NOTE: This is also perhaps questionable. The rationale here is that these errors tend
853853
// to be "operation interrupted", where a cursor has been closed but there is an
854-
// active getMore in-flight.
854+
// active getMore in-flight. This used to check if the cursor was killed but once
855+
// that changed to happen in cleanup legitimate errors would not destroy the
856+
// stream. There are change streams test specifically test these cases.
855857
if (err.message.match(/interrupted/)) {
856858
return readable.push(null);
857859
}

0 commit comments

Comments
 (0)