Skip to content

Commit 17319e7

Browse files
ronagtargos
authored andcommitted
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d79d142 commit 17319e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
685685
this._pendingEncoding = '';
686686

687687
if (!this._handle) {
688-
this.destroy(new ERR_SOCKET_CLOSED(), cb);
688+
cb(new ERR_SOCKET_CLOSED());
689689
return false;
690690
}
691691

0 commit comments

Comments
 (0)