Better error messages for class/object contracts