Skip to content

Commit 0925885

Browse files
author
Ruben Bridgewater
committed
Do not wrap errors into other errors. The trace is going to be manipulated that way.
1 parent 4e42fb7 commit 0925885

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ Multi.prototype.exec = function (callback) {
10551055
if (typeof cur[cur.length - 1] === "function") {
10561056
cur[cur.length - 1](err);
10571057
} else {
1058-
errors.push(new Error(err));
1058+
errors.push(err);
10591059
}
10601060
}
10611061
});
@@ -1065,7 +1065,7 @@ Multi.prototype.exec = function (callback) {
10651065
return this._client.send_command("exec", [], function (err, replies) {
10661066
if (err) {
10671067
if (callback) {
1068-
errors.push(new Error(err));
1068+
errors.push(err);
10691069
callback(errors);
10701070
return;
10711071
} else {

test/commands/multi.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ describe("The 'multi' method", function () {
231231
client.multi().set("foo").exec(function (err, reply) {
232232
assert(Array.isArray(err), "err should be an array");
233233
assert.equal(2, err.length, "err should have 2 items");
234-
assert(err[0].message.match(/ERR/), "First error message should contain ERR");
235-
assert(err[1].message.match(/EXECABORT/), "First error message should contain EXECABORT");
234+
assert(err[0].message.match(/^ERR/), "First error message should begin with ERR");
235+
assert(err[1].message.match(/^EXECABORT/), "First error message should begin with EXECABORT");
236236
return done();
237237
});
238238
});

0 commit comments

Comments
 (0)