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 Trott committed Aug 17, 2019
1 parent 490ec9b commit cc7cec25c5fc2fdb8e055e25162c4b231f19e287
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 cc7cec2

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