bretcope/tedium — pull request #3 by momow (2014-10-10 20:30:52+00:00)
Title: Don't rollback transactions twice

With the newly introduced support of `XACT_ABORT` in tedious (see https://github.com/pekim/tedious/issues/193), the transactions are automatically rollbacked when the `options.abortTransactionOnError` flag is set.

This commit ensures Tedium doesn't attempt to manually rollback transactions that have already been rolled back automatically.

This also ensures that the error that is thrown by Tedium is not about rollbacking a second time (ie `The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION`). Instead, the error thrown is about the invalid request within the transaction.