Make use of `msg` of `UniqueConstraint`
Context
A UniqueConstraint
of YAMS (see yams/constraints.py
) can have a message (through parameter msg
of BaseConstraint
). If the constraint fails, we would like to have the given msg
if one given.
Problem
But we don't have this. Instead, the SQL error is given. It should be catched and replaced by msg
if its booleanity equals True
.
Origin
The problem could seem to come from YAMS. But, YAMS does not do the SQL translation of the constraint, CubicWeb does (see cubicweb/server/schema2sql.py
). That is why we thought it is a CubicWeb issue.