From 83f3b8c4ce6c3252430dad485a44f6416dbdfbbe Mon Sep 17 00:00:00 2001 From: Vladimir Bulyga Date: Thu, 8 May 2014 13:23:15 +0400 Subject: [PATCH 1/2] error event wrapper should always present Signed-off-by: Vladimir Bulyga --- lib/clients/http_client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/clients/http_client.js b/lib/clients/http_client.js index 41a8b85da..a81d000c2 100644 --- a/lib/clients/http_client.js +++ b/lib/clients/http_client.js @@ -158,6 +158,9 @@ function rawRequest(opts, cb) { req.removeAllListeners('error'); req.removeAllListeners('socket'); + + // error event wrapper should always present, if absent, native http module breaks app + req.on('error', function () {}); req.emit('result', (err || null), res); }); req.log = log; From 92979bfe7136566472943358e0b421dbea080b53 Mon Sep 17 00:00:00 2001 From: Dan Lukinykh Date: Tue, 13 May 2014 20:46:51 +0400 Subject: [PATCH 2/2] moving error on --- lib/clients/http_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clients/http_client.js b/lib/clients/http_client.js index a81d000c2..f416e72ab 100644 --- a/lib/clients/http_client.js +++ b/lib/clients/http_client.js @@ -160,7 +160,7 @@ function rawRequest(opts, cb) { req.removeAllListeners('socket'); // error event wrapper should always present, if absent, native http module breaks app - req.on('error', function () {}); + req.on('error', function (err2) { err = err2 }); req.emit('result', (err || null), res); }); req.log = log;