Better error message for setter.
This commit is contained in:
parent
91886e30d2
commit
e62d1cd3ff
@ -288,7 +288,7 @@ impl Engine {
|
|||||||
if let Some(prop) = extract_prop_from_getter(fn_name) {
|
if let Some(prop) = extract_prop_from_getter(fn_name) {
|
||||||
return EvalAltResult::ErrorDotExpr(
|
return EvalAltResult::ErrorDotExpr(
|
||||||
format!(
|
format!(
|
||||||
"Unknown property '{}' for {}, or it is write-only",
|
"Failed to get property '{}' of '{}' - the property may not exist, or it may be write-only",
|
||||||
prop,
|
prop,
|
||||||
self.map_type_name(args[0].type_name())
|
self.map_type_name(args[0].type_name())
|
||||||
),
|
),
|
||||||
@ -301,9 +301,10 @@ impl Engine {
|
|||||||
if let Some(prop) = extract_prop_from_setter(fn_name) {
|
if let Some(prop) = extract_prop_from_setter(fn_name) {
|
||||||
return EvalAltResult::ErrorDotExpr(
|
return EvalAltResult::ErrorDotExpr(
|
||||||
format!(
|
format!(
|
||||||
"Unknown property '{}' for {}, or it is read-only",
|
"Failed to set property '{}' of '{}' - the property may not exist, may be read-only, or '{}' is the wrong type",
|
||||||
prop,
|
prop,
|
||||||
self.map_type_name(args[0].type_name())
|
self.map_type_name(args[0].type_name()),
|
||||||
|
self.map_type_name(args[1].type_name()),
|
||||||
),
|
),
|
||||||
Position::none(),
|
Position::none(),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user