Skip to content
Permalink
Browse files

net: use callback to properly propagate error

The socket will be destroyed upstream through the proper error
flow.

PR-URL: #29178
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
ronag authored and targos committed Aug 17, 2019
1 parent d79d142 commit 17319e7f441d81ab62b01f3e2961d6b38e7b10d3
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/net.js
@@ -685,7 +685,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
this._pendingEncoding = '';

if (!this._handle) {
this.destroy(new ERR_SOCKET_CLOSED(), cb);
cb(new ERR_SOCKET_CLOSED());
return false;
}

0 comments on commit 17319e7

Please sign in to comment.
You can’t perform that action at this time.