Skip to content

Commit 0199c8b

Browse files
committed
fix(ChangeStream): avoid suppressing errors in closed change stream
Fix #14177
1 parent 4a38517 commit 0199c8b

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

lib/cursor/ChangeStream.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ class ChangeStream extends EventEmitter {
6060

6161
driverChangeStreamEvents.forEach(ev => {
6262
this.driverChangeStream.on(ev, data => {
63-
// Sometimes Node driver still polls after close, so
64-
// avoid any uncaught exceptions due to closed change streams
65-
// See tests for gh-7022
66-
if (ev === 'error' && this.closed) {
67-
return;
68-
}
6963
if (data != null && data.fullDocument != null && this.options && this.options.hydrate) {
7064
data.fullDocument = this.options.model.hydrate(data.fullDocument);
7165
}
@@ -83,12 +77,6 @@ class ChangeStream extends EventEmitter {
8377

8478
driverChangeStreamEvents.forEach(ev => {
8579
this.driverChangeStream.on(ev, data => {
86-
// Sometimes Node driver still polls after close, so
87-
// avoid any uncaught exceptions due to closed change streams
88-
// See tests for gh-7022
89-
if (ev === 'error' && this.closed) {
90-
return;
91-
}
9280
if (data != null && data.fullDocument != null && this.options && this.options.hydrate) {
9381
data.fullDocument = this.options.model.hydrate(data.fullDocument);
9482
}

0 commit comments

Comments
 (0)