1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Escape js parser protocol error characters

This commit is contained in:
Ruben Bridgewater
2015-11-26 12:57:20 +01:00
parent f37d5ed14b
commit 56861a89d2
2 changed files with 40 additions and 1 deletions

View File

@@ -137,7 +137,7 @@ JavascriptReplyParser.prototype.run = function (buffer) {
if (this._type !== undefined && this._protocol_error === true) {
// Reset the buffer so the parser can handle following commands properly
this._buffer = new Buffer(0);
this.send_error(new Error('Protocol error, got "' + String.fromCharCode(this._type) + '" as reply type byte'));
this.send_error(new Error('Protocol error, got ' + JSON.stringify(String.fromCharCode(this._type)) + ' as reply type byte'));
}
};