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

Improve error handling

Added individual error classes
Don't silently fail for commands without callback from now on
General polishing (e.g. better error messages)

Fix typos
This commit is contained in:
Ruben Bridgewater
2016-04-25 01:36:49 +02:00
parent bf394923fd
commit 03f1a606f7
18 changed files with 367 additions and 129 deletions

View File

@@ -33,7 +33,7 @@ describe("The 'mset' method", function () {
it('reports an error', function (done) {
client.mset(key, value, key2, value2, function (err, res) {
assert(err.message.match(/The connection has already been closed/));
assert(err.message.match(/The connection is already closed/));
done();
});
});
@@ -96,7 +96,8 @@ describe("The 'mset' method", function () {
// this behavior is different from the 'set' behavior.
it('emits an error', function (done) {
client.on('error', function (err) {
assert.equal(err.message, "ERR wrong number of arguments for 'mset' command");
assert.strictEqual(err.message, "ERR wrong number of arguments for 'mset' command");
assert.strictEqual(err.name, 'ReplyError');
done();
});