[icinga-checkins] icinga.org: icinga2/master: MacroProcessor: Add the argument name for set_if error messages

git at icinga.org git at icinga.org
Wed Jan 11 12:26:18 CET 2017


Module: icinga2
Branch: master
Commit: b51a2c1c25d5f587a92f5f2f9c073a23803eb8d0
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=b51a2c1c25d5f587a92f5f2f9c073a23803eb8d0

Author: Michael Friedrich <michael.friedrich at icinga.com>
Date:   Wed Dec  7 21:53:01 2016 +0100

MacroProcessor: Add the argument name for set_if error messages

fixes #13345

---

 lib/icinga/macroprocessor.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp
index 2ac63db..37d5d48 100644
--- a/lib/icinga/macroprocessor.cpp
+++ b/lib/icinga/macroprocessor.cpp
@@ -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;



More information about the icinga-checkins mailing list