summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/net.js b/lib/net.js
index 38d90925b1..65255da26c 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -651,7 +651,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
}
if (err)
- return this._destroy(errnoException(err, 'write'), cb);
+ return this._destroy(errnoException(err, 'write', req.error), cb);
this._bytesDispatched += req.bytes;
@@ -745,7 +745,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() {
});
-function afterWrite(status, handle, req) {
+function afterWrite(status, handle, req, err) {
var self = handle.owner;
if (self !== process.stderr && self !== process.stdout)
debug('afterWrite', status);
@@ -757,7 +757,7 @@ function afterWrite(status, handle, req) {
}
if (status < 0) {
- var ex = errnoException(status, 'write');
+ var ex = errnoException(status, 'write', err);
debug('write failure', ex);
self._destroy(ex, req.cb);
return;