From 75cf487d739cf5cff534cb5499270b0b24814c7e Mon Sep 17 00:00:00 2001 From: Mathieu M-Gosselin Date: Fri, 30 Aug 2013 12:58:28 -0400 Subject: [PATCH] When handling the "error reply" event from the parser, we now bubble up the Error object if it's one instead of wrapping it in another Error. --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index aa73e38772..b83492f916 100644 --- a/index.js +++ b/index.js @@ -302,7 +302,11 @@ RedisClient.prototype.init_parser = function () { // "reply error" is an error sent back by Redis this.reply_parser.on("reply error", function (reply) { - self.return_error(new Error(reply)); + if (reply instanceof Error) { + self.return_error(reply); + } else { + self.return_error(new Error(reply)); + } }); this.reply_parser.on("reply", function (reply) { self.return_reply(reply);