1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

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.

This commit is contained in:
Mathieu M-Gosselin
2013-08-30 12:58:28 -04:00
committed by Bryce Baril
parent d5c7a2ce2e
commit 75cf487d73

View File

@@ -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);