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

Fix js parser sending non-Errors

This commit is contained in:
Ruben Bridgewater
2015-09-02 00:43:08 +02:00
parent 614366ffeb
commit 52db91c753
2 changed files with 5 additions and 8 deletions

View File

@@ -302,11 +302,7 @@ RedisClient.prototype.init_parser = function () {
// "reply error" is an error sent back by Redis
this.reply_parser.on("reply error", function (reply) {
if (reply instanceof Error) {
self.return_error(reply);
} else {
self.return_error(new Error(reply));
}
self.return_error(reply);
});
this.reply_parser.on("reply", function (reply) {
self.return_reply(reply);
@@ -654,7 +650,9 @@ RedisClient.prototype.return_reply = function (reply) {
}
try_callback(command_obj.callback, reply);
} else debug("no callback for reply: " + (reply && reply.toString && reply.toString()));
} else {
debug("no callback for reply: " + (reply && reply.toString && reply.toString()));
}
} else if (this.pub_sub_mode || (command_obj && command_obj.sub_command)) {
if (Array.isArray(reply)) {
type = reply[0].toString();