Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ export class MongoInstance extends EventEmitter implements ManagerBase {
if (
!(
err instanceof MongoNetworkError &&
/^connection \d+ to [\d.]+:\d+ closed$/i.test(err.message)
/^connection \d+ to [\d.]+:\d+ closed$/i.test(err.message) ||
'read ECONNRESET' === err.message
Comment on lines +466 to +467
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/^connection \d+ to [\d.]+:\d+ closed$/i.test(err.message) ||
'read ECONNRESET' === err.message
(/^connection \d+ to [\d.]+:\d+ closed$/i.test(err.message) ||
'read ECONNRESET' === err.message)

To make use of the typescript check that message exists; or is it not a MongoNetworkError?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. It's not MongoNetworkError.

)
) {
console.warn(err);
Expand Down
Loading