Open Qqwy opened 5 years ago
Can you please add Ecto version that you are using?
This is on the newest Ecto that EctoMnesia supports, which is 2.1 IIRC.
I was able to find the cause of this problem, btw. It's here. The rollback
function is expected to take the reason as second argument, but EctoMnesia uses an unused _tid
argument and hard-codes Mnesia.abort
with the reason :rollback
.
This causes Ecto.Multi
's transaction handling logic (see here to crash because it expects the error result contain a four-element tuple rather than :rollback
.
Whenever creating an Ecto.Multi that returns an error. (Such as by using
Ecto.Multi.error
or by returning{:error, val}
rather than{:ok, val}
from anEcto.Multi.run
), this is not properly passed up through theRepo.transaction
call.Furthermore, rather than passing a value up, a
CaseClauseError
is raised.Example:
Expected result:
Actual result: