From: Gunnar Beutner Date: Wed, 6 Feb 2013 12:25:04 +0000 (+0100) Subject: Fixed error message for the method validator. X-Git-Tag: v0.0.2~534 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07e85650451dc549b2dc013b8a3248a456a9c646;p=icinga2 Fixed error message for the method validator. --- diff --git a/lib/config/configtype.cpp b/lib/config/configtype.cpp index 0c4dfadc4..1d9a56310 100644 --- a/lib/config/configtype.cpp +++ b/lib/config/configtype.cpp @@ -184,10 +184,16 @@ void ConfigType::ValidateMethods(const ScriptTask::Ptr& task, Dictionary::Ptr attrs = arguments[1]; String key; - BOOST_FOREACH(tie(key, tuples::ignore), attrs) { - if (!ScriptFunction::GetByName(key)) { + Value value; + BOOST_FOREACH(tie(key, value), attrs) { + if (!value.IsScalar()) + continue; + + String method = value; + + if (!ScriptFunction::GetByName(method)) { ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " + - location + ": Method '" + key + "' not found."); + location + ": Script function '" + method + "' not found."); } }