Skip to content

Commit 302ff72

Browse files
committed
net: surface errors from setKeepAlive handle calls
1 parent 54b4e37 commit 302ff72

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/net.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,10 @@ Socket.prototype.setKeepAlive = function(enable, initialDelayMsecs,
885885
this[kSetKeepAliveInitialDelay] = initialDelay;
886886
this[kSetKeepAliveInterval] = interval;
887887
this[kSetKeepAliveCount] = count;
888-
this._handle.setKeepAlive(enable, initialDelay, interval, count);
888+
const err = this._handle.setKeepAlive(enable, initialDelay, interval, count);
889+
if (err && !isWindows) {
890+
throw new ErrnoException(err, 'setKeepAlive');
891+
}
889892
}
890893

891894
return this;

0 commit comments

Comments
 (0)