Skip to content

Commit

Permalink
fix: more meaningful errors when using pipeline after exec(). (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
rimiti authored and luin committed May 7, 2019
1 parent 115a9f4 commit 0c3ef01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export function addTransactionSupport (redis) {
const promise = exec.call(pipeline)
return asCallback(promise.then(function (result) {
const execResult = result[result.length - 1]
if (typeof execResult === 'undefined') {
throw new Error('Pipeline cannot be used to send any commands when the `exec()` has been called on it.');
}
if (execResult[0]) {
execResult[0].previousErrors = []
for (let i = 0; i < result.length - 1; ++i) {
Expand Down

0 comments on commit 0c3ef01

Please sign in to comment.