Ecto insert_all handle constraint

I have a bulk insert with insert_all. The destination table has an excluding constraint. At the end of unsuccessful insert operation I have a Postgrex.Error in my rescue func, Is there any way to adopt this error into something more convenient like changeset error?
The option to make Repo,transaction and insert using, fn cs -> 

is not good I think

You can try using the exclusion_constraint:

Best regards,

1 Like