From 7a805e595a11754259022d722894a865e7e7f2eb Mon Sep 17 00:00:00 2001 From: Denis Samoylov Date: Fri, 25 Jul 2014 16:02:47 -0700 Subject: [PATCH 1/2] add callback in case of connection failure --- lib/memcached.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/memcached.js b/lib/memcached.js index 15b26e6..b7ab4f4 100644 --- a/lib/memcached.js +++ b/lib/memcached.js @@ -159,6 +159,11 @@ Client.config = { , streamError = function(e) { memcached.connectionIssue(e.toString(), S); Manager.remove(this); + var metaData = S.metaData.shift(); + if (metaData && metaData.callback){ + metaData.execution = Date.now() - metaData.start; + memcached.delegateCallback(metaData, new Error('Stream error'), false, metaData.callback); + } }; // config the Stream From 02b33f04a5f1c07f0b1c4ecb3246a48a14c88013 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 31 Jul 2014 15:56:37 -0700 Subject: [PATCH 2/2] log error in streamError instead of creating new one --- lib/memcached.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/memcached.js b/lib/memcached.js index b7ab4f4..4112a1f 100644 --- a/lib/memcached.js +++ b/lib/memcached.js @@ -162,7 +162,7 @@ Client.config = { var metaData = S.metaData.shift(); if (metaData && metaData.callback){ metaData.execution = Date.now() - metaData.start; - memcached.delegateCallback(metaData, new Error('Stream error'), false, metaData.callback); + memcached.delegateCallback(metaData, e, false, metaData.callback); } };