-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.7.0
-
Component/s: Change Streams
Use Case
As a software developer
I want the mongodb driver to not throw an uncatchable error
So that my code will function in production
User Impact
- uncatchable error will crash production servers and impact all users of that service
Dependencies
- none
FIX:
In abstract_cursor.ts the `_destroy()` needs to change from:
override _destroy(error: Error | null, callback: (error?: Error | null) => void): void { // eslint-disable-next-line github/no-then this._cursor.close().then(() => callback(error),closeError => callback(closeError) ); }
TO:
override _destroy(error: Error | null, callback: (error?: Error | null) => void): void { // eslint-disable-next-line github/no-then if (!this._cursor.closed) { this._cursor.close().then(() => callback(error),closeError => callback(closeError) ); } }