Enhance and correct error messages

This commit is contained in:
Jason Turner
2011-09-25 16:46:05 -06:00
parent 3329732ceb
commit 702b5fdba1
5 changed files with 137 additions and 40 deletions

View File

@@ -587,17 +587,14 @@ namespace chaiscript
class dispatch_error : public std::runtime_error
{
public:
dispatch_error() noexcept
: std::runtime_error("No matching function to dispatch to")
dispatch_error(const std::vector<Boxed_Value> &t_bvs)
: std::runtime_error("Error with function dispatch"), parameters(t_bvs)
{
}
dispatch_error(bool is_const) noexcept
: std::runtime_error(std::string("No matching function to dispatch to") + (is_const?", parameter is const":""))
{
}
virtual ~dispatch_error() noexcept {}
std::vector<Boxed_Value> parameters;
};
}
@@ -631,7 +628,7 @@ namespace chaiscript
++begin;
}
throw exception::dispatch_error(plist.empty()?false:plist[0].is_const());
throw exception::dispatch_error(plist);
}
/**