At the moment SmartProperties::InvalidValueError comes with messages such as
UiIcon does not accept 10 as a value for the property size
This can be very unhelpful for consumers. It would be better to output information about the set of accepted values, or the path of the proc that determines them.
eg.
UiIcon does not accept 10 as a value for the property size. Property only accepts [16, 32, 64]
SheepWidget does not accept :big as a value for the property size. Property only accepts [Numeric]
ButtonWidget does not accept :excited for property type. Property only accepts values evaluated as truthy by Proc defined at mycode/src/widgets/button_widget.rb at line 35.
I'm not sure about the wording on some of these cases, but I think it gets the intention across.
At the moment
SmartProperties::InvalidValueError
comes with messages such asThis can be very unhelpful for consumers. It would be better to output information about the set of accepted values, or the path of the proc that determines them.
eg.
I'm not sure about the wording on some of these cases, but I think it gets the intention across.