diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-09-08 13:46:57 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-09-08 20:47:16 +0200 |
commit | bb3a1d5b675511fdd287009e01430fc96f286cd0 (patch) | |
tree | fd8debe5753dc919fd34034a0008ccd82b7b95a5 /lib/http2.js | |
parent | 6139459d45f4205553c889682ac9c9361e3e2a5f (diff) | |
download | android-node-v8-bb3a1d5b675511fdd287009e01430fc96f286cd0.tar.gz android-node-v8-bb3a1d5b675511fdd287009e01430fc96f286cd0.tar.bz2 android-node-v8-bb3a1d5b675511fdd287009e01430fc96f286cd0.zip |
http: set .code='ECONNRESET' on socket hang up errors
Fixes #1672.
Diffstat (limited to 'lib/http2.js')
-rw-r--r-- | lib/http2.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/http2.js b/lib/http2.js index c5a32beb94..a42a613c13 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -1146,7 +1146,9 @@ ClientRequest.prototype.onSocket = function(socket) { // This socket error fired before we started to // receive a response. The error needs to // fire on the request. - req.emit('error', new Error('socket hang up')); + var error = new Error('socket hang up'); + error.code = 'ECONNRESET'; + req.emit('error', error); } } socket.on('close', closeListener); |