Commit 94e2cbf9 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Fix rollaback behavior (issue #480)

This commit fixes the bug with DbTx rollbacks and domain-specific
errors. What we do now is throwing an exception during the evaluation of
`DbFail`, to later catch it _after_ `withTransactionM` has performed a
clean rollback, and only at that point we call `throwError`.

This also means that we need to catch `DbTx` errors via the `MonadError`
interface, not via the exception-handling interface, to get proper
rollback behavior.
parent 900fe0b9
Pipeline #7693 failed with stages
in 37 minutes and 55 seconds