Skip to content

Commit

Permalink
Use the err.code property to check for ECONNRESET error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Nehmer committed Oct 28, 2021
1 parent 3c300a8 commit 8cf8d24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Connection extends EventEmitter {
this.connectTimeout = null;
}
// Do not throw an error when a connection ends with a RST,ACK packet
if (err.errno === 'ECONNRESET' && this._closing) {
if (err.code === 'ECONNRESET' && this._closing) {
return;
}
this._handleFatalError(err);
Expand Down

0 comments on commit 8cf8d24

Please sign in to comment.