Skip to content

Commit d961de0

Browse files
committed
net: remove unreachable error
When creating a socket, if the file descriptor is not a valid PIPE or TCP type, createHandle throws an ERR_INVALID_FD_TYPE. This means that `this._handle.open` is guaranteed to succeed and will never return an error.
1 parent 8c3f903 commit d961de0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/net.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@ function Socket(options) {
266266

267267
this._handle = createHandle(fd, false);
268268

269-
err = this._handle.open(fd);
270-
if (err)
271-
throw errnoException(err, 'open');
269+
this._handle.open(fd);
272270

273271
this[async_id_symbol] = this._handle.getAsyncId();
274272
// options.fd can be string (since it is user-defined),

0 commit comments

Comments
 (0)