diff --git a/lib/net.js b/lib/net.js index 7767b000862..383269c76f6 100644 --- a/lib/net.js +++ b/lib/net.js @@ -38,7 +38,7 @@ var WriteWrap = process.binding('stream_wrap').WriteWrap; var cluster; var errnoException = util._errnoException; -var detailedException = util._detailedException; +var exceptionWithHostPort = util._exceptionWithHostPort; function noop() {} @@ -763,7 +763,7 @@ function afterWrite(status, handle, req, err) { } if (status < 0) { - var ex = detailedException(status, 'write', req.address, req.port); + var ex = exceptionWithHostPort(status, 'write', req.address, req.port); debug('write failure', ex); self._destroy(ex, req.cb); return; @@ -809,7 +809,7 @@ function connect(self, address, port, addressType, localAddress, localPort) { err = bind(localAddress, localPort); if (err) { - var ex = detailedException(err, 'bind', localAddress, localPort); + var ex = exceptionWithHostPort(err, 'bind', localAddress, localPort); self._destroy(ex); return; } @@ -841,7 +841,7 @@ function connect(self, address, port, addressType, localAddress, localPort) { ex.localPort = self._sockname.port; details = ex.localAddress + ':' + ex.localPort; } - var ex = detailedException(err, 'connect', address, port, details); + var ex = exceptionWithHostPort(err, 'connect', address, port, details); self._destroy(ex); } } @@ -1001,11 +1001,11 @@ function afterConnect(status, handle, req, readable, writable) { ex.localPort = req.localPort; details = ex.localAddress + ':' + ex.localPort; } - var ex = detailedException(status, - 'connect', - req.address, - req.port, - details); + var ex = exceptionWithHostPort(status, + 'connect', + req.address, + req.port, + details); self._destroy(ex); } } @@ -1135,7 +1135,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { debug('_listen2: create a handle'); var rval = createServerHandle(address, port, addressType, fd); if (util.isNumber(rval)) { - var error = detailedException(rval, 'listen', address, port); + var error = exceptionWithHostPort(rval, 'listen', address, port); process.nextTick(function() { self.emit('error', error); }); @@ -1152,7 +1152,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { var err = _listen(self._handle, backlog); if (err) { - var ex = detailedException(err, 'listen', address, port); + var ex = exceptionWithHostPort(err, 'listen', address, port); self._handle.close(); self._handle = null; process.nextTick(function() { @@ -1201,7 +1201,7 @@ function listen(self, address, port, addressType, backlog, fd, exclusive) { } if (err) { - var ex = detailedException(err, 'bind', address, port); + var ex = exceptionWithHostPort(err, 'bind', address, port); return self.emit('error', ex); } diff --git a/lib/util.js b/lib/util.js index 5f3e59cc641..e6c34670e4d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -758,7 +758,11 @@ exports._errnoException = function(err, syscall, original) { }; -exports._detailedException = function(err, syscall, address, port, additional) { +exports._exceptionWithHostPort = function(err, + syscall, + address, + port, + additional) { var details; if (port && port > 0) { details = address + ':' + port;