Skip to content

Commit

Permalink
doc: update comment on interrupted error check
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Aug 3, 2021
1 parent 794fe7a commit 8ab4cfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cursor/abstract_cursor.ts
Expand Up @@ -851,7 +851,9 @@ function makeCursorStream<TSchema extends Document>(cursor: AbstractCursor<TSche

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

0 comments on commit 8ab4cfa

Please sign in to comment.