Constraint errors
Thrown as ConstraintError (code: "constraint"). Each entry is an identifier (error.id), then the message as the error states it, where {expression} stands for the value of that expression in the source ({…} for one too long to show), then what to do about it: the text useFullErrorMessages(messages) and explain(error) add, where {name} stands for the error's parameter of that name. See Errors.
constraint.undeclared
{first} The changeset has not defined this constraint.
Add: {add}
constraint.violated
{message}
The database rejected the write: {what} constraint{name}{where} was violated.
To report this as a changeset error instead of an exception, declare the constraint on the changeset before the write: uniqueConstraint for a unique constraint, foreignKeyConstraint for a foreign key (or noAssocConstraint on the referenced side), checkConstraint, exclusionConstraint, or validateRequired for a not-null column.

