Skip to content

Commit

Permalink
Timeout errors shouldn't silently ignore the passed errors, but rathe…
Browse files Browse the repository at this point in the history
…r reject with original error. Fixes knex#2582
  • Loading branch information
Simon Lidén committed May 23, 2018
1 parent db390b1 commit 91390b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ export default class Transaction extends EventEmitter {
return this.query(conn, 'ROLLBACK;', 2, error)
.timeout(5000)
.catch(Promise.TimeoutError, () => {
this._resolver();
this._rejecter(error);
});
}

rollbackTo(conn, error) {
return this.query(conn, `ROLLBACK TO SAVEPOINT ${this.txid}`, 2, error)
.timeout(5000)
.catch(Promise.TimeoutError, () => {
this._resolver();
this._rejecter(error);
});
}

Expand Down

0 comments on commit 91390b5

Please sign in to comment.