Fixed error message for the method validator.

This commit is contained in:
Gunnar Beutner 2013-02-06 13:25:04 +01:00
parent 07b50ecce8
commit 07e8565045
1 changed files with 9 additions and 3 deletions

View File

@ -184,10 +184,16 @@ void ConfigType::ValidateMethods(const ScriptTask::Ptr& task,
Dictionary::Ptr attrs = arguments[1]; Dictionary::Ptr attrs = arguments[1];
String key; String key;
BOOST_FOREACH(tie(key, tuples::ignore), attrs) { Value value;
if (!ScriptFunction::GetByName(key)) { BOOST_FOREACH(tie(key, value), attrs) {
if (!value.IsScalar())
continue;
String method = value;
if (!ScriptFunction::GetByName(method)) {
ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " + ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " +
location + ": Method '" + key + "' not found."); location + ": Script function '" + method + "' not found.");
} }
} }