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

Use built-in error classes to make errors more specific

This commit is contained in:
Ruben Bridgewater
2016-04-25 01:35:56 +02:00
parent 5368e7477e
commit bf394923fd
3 changed files with 9 additions and 10 deletions

View File

@@ -46,7 +46,6 @@ function multi_callback (self, err, replies) {
if (err) {
err.errors = self.errors;
err.command = 'EXEC';
if (self.callback) {
self.callback(err);
// Exclude connection errors so that those errors won't be emitted twice
@@ -86,7 +85,7 @@ function multi_callback (self, err, replies) {
Multi.prototype.exec_transaction = function exec_transaction (callback) {
if (this.monitoring || this._client.monitoring) {
var err = new Error(
var err = new RangeError(
'Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis.'
);
err.command = 'EXEC';