Update method error output to show the expression it is trying to execute.
This commit is contained in:
parent
39d817469c
commit
45f07f9924
@ -233,7 +233,7 @@ namespace chaiscript
|
|||||||
funcs.push_back(f);
|
funcs.push_back(f);
|
||||||
throw exception::eval_error("Error calling function '" + this->children[0]->text + "'", plb.objects, funcs, false, t_ss);
|
throw exception::eval_error("Error calling function '" + this->children[0]->text + "'", plb.objects, funcs, false, t_ss);
|
||||||
} catch (const exception::bad_boxed_cast &) {
|
} catch (const exception::bad_boxed_cast &) {
|
||||||
throw exception::eval_error("'" + this->children[0]->text + "' is not a function.");
|
throw exception::eval_error("'" + this->children[0]->pretty_print() + "' does not evaluate to a function.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const exception::arity_error &e){
|
catch(const exception::arity_error &e){
|
||||||
@ -289,7 +289,7 @@ namespace chaiscript
|
|||||||
try {
|
try {
|
||||||
fn = boxed_cast<const Const_Proxy_Function &>(bv);
|
fn = boxed_cast<const Const_Proxy_Function &>(bv);
|
||||||
} catch (const exception::bad_boxed_cast &) {
|
} catch (const exception::bad_boxed_cast &) {
|
||||||
throw exception::eval_error("'" + this->children[0]->text + "' is not a function.");
|
throw exception::eval_error("'" + this->children[0]->pretty_print() + "' does not evaluate to a function.");
|
||||||
}
|
}
|
||||||
return (*fn)(plb);
|
return (*fn)(plb);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user