Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
class AttributeTypeError
super Error
class AttributeTypeError
super Error
+ autoinit receiver, attribute_name, attribute, expected_type
+
# Parent object of the problematic attribute
var receiver: Object
# Parent object of the problematic attribute
var receiver: Object
# Name of the type expected for `attribute`
var expected_type: String
# Name of the type expected for `attribute`
var expected_type: String
+ redef var message is lazy do
var attribute = attribute
var found_type = if attribute != null then attribute.class_name else "null"
var attribute = attribute
var found_type = if attribute != null then attribute.class_name else "null"
var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}")
if not {{{name}}} isa {{{type_name}}} then
# Check if it was a subjectent error
var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}")
if not {{{name}}} isa {{{type_name}}} then
# Check if it was a subjectent error
- v.errors.add new AttributeTypeError("TODO remove this arg on c_src regen",
- self, "{{{attribute.serialize_name}}}", {{{name}}}, "{{{type_name}}}")
+ v.errors.add new AttributeTypeError(self, "{{{attribute.serialize_name}}}", {{{name}}}, "{{{type_name}}}")
# Clear subjacent error
if v.keep_going == false then return
# Clear subjacent error
if v.keep_going == false then return