Add type attribute to ConstraintError