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

Parser should only catch parser errors and bubble the rest to the caller.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
This commit is contained in:
Bryce Baril
2013-02-23 21:13:20 -08:00
committed by DTrejo
parent 0c172f425c
commit 9127f34393
2 changed files with 42 additions and 10 deletions

28
test.js
View File

@@ -291,6 +291,34 @@ tests.MULTI_6 = function () {
});
};
tests.FWD_ERRORS_1 = function () {
var name = "FWD_ERRORS_1";
var toThrow = new Error("Forced exception");
var recordedError = null;
var originalHandler = client3.listeners("error").pop();
client3.once("error", function (err) {
recordedError = err;
});
client3.on("message", function (channel, data) {
console.log("incoming");
if (channel == name) {
assert.equal(data, "Some message");
throw toThrow;
}
});
client3.subscribe(name);
client.publish(name, "Some message");
setTimeout(function () {
client3.listeners("error").push(originalHandler);
assert.equal(recordedError, toThrow, "Should have caught our forced exception");
next(name);
}, 150);
};
tests.EVAL_1 = function () {
var name = "EVAL_1";