You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Do not wrap errors into other errors. The trace is going to be manipulated that way.
This commit is contained in:
4
index.js
4
index.js
@@ -1055,7 +1055,7 @@ Multi.prototype.exec = function (callback) {
|
|||||||
if (typeof cur[cur.length - 1] === "function") {
|
if (typeof cur[cur.length - 1] === "function") {
|
||||||
cur[cur.length - 1](err);
|
cur[cur.length - 1](err);
|
||||||
} else {
|
} else {
|
||||||
errors.push(new Error(err));
|
errors.push(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1065,7 +1065,7 @@ Multi.prototype.exec = function (callback) {
|
|||||||
return this._client.send_command("exec", [], function (err, replies) {
|
return this._client.send_command("exec", [], function (err, replies) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
errors.push(new Error(err));
|
errors.push(err);
|
||||||
callback(errors);
|
callback(errors);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -231,8 +231,8 @@ describe("The 'multi' method", function () {
|
|||||||
client.multi().set("foo").exec(function (err, reply) {
|
client.multi().set("foo").exec(function (err, reply) {
|
||||||
assert(Array.isArray(err), "err should be an array");
|
assert(Array.isArray(err), "err should be an array");
|
||||||
assert.equal(2, err.length, "err should have 2 items");
|
assert.equal(2, err.length, "err should have 2 items");
|
||||||
assert(err[0].message.match(/ERR/), "First error message should contain ERR");
|
assert(err[0].message.match(/^ERR/), "First error message should begin with ERR");
|
||||||
assert(err[1].message.match(/EXECABORT/), "First error message should contain EXECABORT");
|
assert(err[1].message.match(/^EXECABORT/), "First error message should begin with EXECABORT");
|
||||||
return done();
|
return done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user