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 #2582 (#2626)
  • Loading branch information
Simon Lidén authored and elhigu committed Jun 5, 2018
1 parent 1c65e69 commit 27250b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transaction.js
Expand Up @@ -101,15 +101,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 27250b6

Please sign in to comment.