]> granicus.if.org Git - icinga2/commitdiff
MacroProcessor: Add the argument name for set_if error messages
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 7 Dec 2016 20:53:01 +0000 (21:53 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 11 Jan 2017 11:26:09 +0000 (12:26 +0100)
fixes #13345

lib/icinga/macroprocessor.cpp

index 2ac63db2cb561528ccc2fd95333e6c3cf8251964..37d5d48cc77e76e0c0d836f401411eedb73b62d2 100644 (file)
@@ -512,7 +512,8 @@ Value MacroProcessor::ResolveArguments(const Value& command, const Dictionary::P
                                                } catch (const std::exception& ex) {
                                                        /* tried to convert a string */
                                                        Log(LogWarning, "PluginUtility")
-                                                           << "Error evaluating set_if value '" << set_if_resolved << "': " << ex.what();
+                                                           << "Error evaluating set_if value '" << set_if_resolved
+                                                           << "' used in argument '" << arg.Key << "': " << ex.what();
                                                        continue;
                                                }
                                        }
@@ -550,7 +551,8 @@ Value MacroProcessor::ResolveArguments(const Value& command, const Dictionary::P
                for (const CommandArgument& arg : args) {
 
                        if (arg.AValue.IsObjectType<Dictionary>()) {
-                               Log(LogWarning, "PluginUtility", "Tried to use dictionary in argument");
+                               Log(LogWarning, "PluginUtility")
+                                   << "Tried to use dictionary in argument '" << arg.Key << "'.";
                                continue;
                        } else if (arg.AValue.IsObjectType<Array>()) {
                                bool first = true;