From 45f07f9924595fcb4c35fcbaf976a843ee06cd33 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 25 Jun 2012 16:26:36 -0600 Subject: [PATCH] Update method error output to show the expression it is trying to execute. --- include/chaiscript/language/chaiscript_eval.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index 4d21147..ea7902f 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -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(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); }