不要怂,就是干,撸起袖子干!

Commit e6e0a303 by Aaron Nielsen

Reject with original error if transaction is finished

1 parent 5fcf76d7
Showing with 2 additions and 5 deletions
......@@ -1236,11 +1236,8 @@ Sequelize.prototype.transaction = function(options, autoCallback) {
});
});
}).catch(function(err) {
// If an error occured while commiting a transaction do not try to rollback the transaction
if (transaction.finished === 'commit') {
reject(err);
} else if (transaction.finished === 'rollback'){
// Already in rollback state. Reject with the original error.
// If the transaction has already finished (commit, rollback, etc), reject with the original error
if (transaction.finished) {
reject(err);
} else {
transaction.rollback().finally(function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!