Update method error output to show the expression it is trying to execute.

This commit is contained in:
Jason Turner 2012-06-25 16:26:36 -06:00
parent 39d817469c
commit 45f07f9924

View File

@ -233,7 +233,7 @@ namespace chaiscript
funcs.push_back(f);
throw exception::eval_error("Error calling function '" + this->children[0]->text + "'", plb.objects, funcs, false, t_ss);
} 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){
@ -289,7 +289,7 @@ namespace chaiscript
try {
fn = boxed_cast<const Const_Proxy_Function &>(bv);
} 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);
}