We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8efaee4 commit 3ad46f4Copy full SHA for 3ad46f4
src/change_stream.ts
@@ -938,10 +938,12 @@ export class ChangeStream<
938
.selectServer(this.cursor.readPreference, {
939
operationName: 'reconnect topology in change stream'
940
})
941
- .catch(serverSelectionError => {
942
- if (serverSelectionError) return this._closeEmitterModeWithError(changeStreamError);
943
- this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions);
944
- });
+ .then(
+ () => {
+ this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions);
+ },
945
+ () => this._closeEmitterModeWithError(changeStreamError)
946
+ );
947
} else {
948
this._closeEmitterModeWithError(changeStreamError);
949
}
0 commit comments