Fix bug in DB transaction rollbacks in the presence of domain-specific errors
Fixes #480.
I have added tests and extensive documentation to explain what's going on, but in a nutshell the problem was twofold:
- In the
evalOp
evaluator we needed to throw an exception (not an error, the distinction is key) so thatwithTransactionM
could activate the rollback behaviour; - We needed to catch errors via
catchError
& friends if we wanted to test things properly in the tests.