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

fix unescaped exception in Multi.exec

This commit is contained in:
Thanasis Polychronakis
2013-04-18 21:48:35 +03:00
parent e63947b0b6
commit c7633bf738

View File

@@ -1037,7 +1037,12 @@ 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 {
throw new Error(err); if (callback) {
callback(new Error(err));
return;
} else {
throw new Error(err);
}
} }
self.queue.splice(index, 1); self.queue.splice(index, 1);
} }