When user misuses transactions, one could get assertion error.
Currently, when we start optimistic transaction, do some work within it and
try to resume it(which is incorrect behavior) assertion error is thrown. It
On the contrary more descriptive exception should be thrown.
In my fix exception handling is reworked, plz review it:
review in upsource .