Skip to content

Commit

Permalink
return a rejected promise on commit or rollback errors (sequelize#6282)
Browse files Browse the repository at this point in the history
  • Loading branch information
connyay authored and mickhansen committed Jul 16, 2016
1 parent 8a4f528 commit 53bbda5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Transaction {
commit() {

if (this.finished) {
throw new Error('Transaction cannot be committed because it has been finished with state: ' + this.finished);
return Utils.Promise.reject(new Error('Transaction cannot be committed because it has been finished with state: ' + this.finished));
}

this.$clearCls();
Expand All @@ -79,7 +79,7 @@ class Transaction {
rollback() {

if (this.finished) {
throw new Error('Transaction cannot be rolled back because it has been finished with state: ' + this.finished);
return Utils.Promise.reject(new Error('Transaction cannot be rolled back because it has been finished with state: ' + this.finished));
}

this.$clearCls();
Expand Down

0 comments on commit 53bbda5

Please sign in to comment.