My last question(hopefully
), when I tried to insert into db, I’ve got an exception:
iex(5)> e = Repo.insert(c)
[debug] QUERY ERROR db=16.0ms
INSERT INTO "countries" ("iso_country","iso_language","name","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5) RETURNING "id" ["YY", "DE", "Schweiz", {{2016, 11, 24}, {13, 28, 8, 0}}, {{2016, 11, 24}, {13, 28, 8, 0}}]
** (Ecto.ConstraintError) constraint error when attempting to insert struct:
If you would like to convert this constraint into an error, please
call foreign_key_constraint/3 in your changeset and define the proper
constraint name. The changeset defined the following constraints:
How to get a message instead raised exception?
In doc Ecto.Repo — Ecto v3.14.0 it says, I should get a tuple.
Thanks






















