Skip to content

Commit 0c3ef01

Browse files
rimitiluin
authored andcommitted
fix: more meaningful errors when using pipeline after exec(). (#858)
1 parent 115a9f4 commit 0c3ef01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/transaction.ts

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export function addTransactionSupport (redis) {
3434
const promise = exec.call(pipeline)
3535
return asCallback(promise.then(function (result) {
3636
const execResult = result[result.length - 1]
37+
if (typeof execResult === 'undefined') {
38+
throw new Error('Pipeline cannot be used to send any commands when the `exec()` has been called on it.');
39+
}
3740
if (execResult[0]) {
3841
execResult[0].previousErrors = []
3942
for (let i = 0; i < result.length - 1; ++i) {

0 commit comments

Comments
 (0)