I have a use case where I want to a dry run of the transaction, and rollback right before returning. The docs are not very clear about the preferred way to achieve this. I decided to return my own error object that I can check for to know that it isn't a real error.
It would be nicer if this library defined a special ErrRollback value, and if it sees that value, rollback the transaction instead of committing, and then also don't return any error to the outer function. It would simplify the error handling code a bit.
I have a use case where I want to a dry run of the transaction, and rollback right before returning. The docs are not very clear about the preferred way to achieve this. I decided to return my own error object that I can check for to know that it isn't a real error.
It would be nicer if this library defined a special
ErrRollback
value, and if it sees that value, rollback the transaction instead of committing, and then also don't return any error to the outer function. It would simplify the error handling code a bit.