You've already forked node-redis
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:
10
index.js
10
index.js
@@ -302,11 +302,7 @@ RedisClient.prototype.init_parser = function () {
|
|||||||
|
|
||||||
// "reply error" is an error sent back by Redis
|
// "reply error" is an error sent back by Redis
|
||||||
this.reply_parser.on("reply error", function (reply) {
|
this.reply_parser.on("reply error", function (reply) {
|
||||||
if (reply instanceof Error) {
|
self.return_error(reply);
|
||||||
self.return_error(reply);
|
|
||||||
} else {
|
|
||||||
self.return_error(new Error(reply));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
this.reply_parser.on("reply", function (reply) {
|
this.reply_parser.on("reply", function (reply) {
|
||||||
self.return_reply(reply);
|
self.return_reply(reply);
|
||||||
@@ -654,7 +650,9 @@ RedisClient.prototype.return_reply = function (reply) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try_callback(command_obj.callback, 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)) {
|
} else if (this.pub_sub_mode || (command_obj && command_obj.sub_command)) {
|
||||||
if (Array.isArray(reply)) {
|
if (Array.isArray(reply)) {
|
||||||
type = reply[0].toString();
|
type = reply[0].toString();
|
||||||
|
@@ -177,8 +177,7 @@ ReplyParser.prototype.execute = function (buffer) {
|
|||||||
if (ret === null) {
|
if (ret === null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this.send_error(new Error(ret));
|
||||||
this.send_error(ret);
|
|
||||||
} else if (type === 58) { // :
|
} else if (type === 58) { // :
|
||||||
ret = this._parseResult(type);
|
ret = this._parseResult(type);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user