From: Gunnar Beutner Date: Thu, 24 Sep 2015 06:29:13 +0000 (+0200) Subject: Fix incorrect error messages for apply-for X-Git-Tag: v2.3.11~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=992e045355b0d63d264db4dfbcf869dca88b5969;p=icinga2 Fix incorrect error messages for apply-for fixes #10205 --- diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index 14d2b84bf..190f972db 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -117,7 +117,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR if (vinstances.IsObjectType()) { if (!rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); Array::Ptr arr = vinstances; Array::Ptr arrclone = arr->ShallowClone(); @@ -136,7 +136,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR } } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); Dictionary::Ptr dict = vinstances; diff --git a/lib/icinga/notification-apply.cpp b/lib/icinga/notification-apply.cpp index fd8e5a3b3..f00500188 100644 --- a/lib/icinga/notification-apply.cpp +++ b/lib/icinga/notification-apply.cpp @@ -116,7 +116,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl if (vinstances.IsObjectType()) { if (!rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); Array::Ptr arr = vinstances; @@ -134,7 +134,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl } } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); Dictionary::Ptr dict = vinstances; diff --git a/lib/icinga/scheduleddowntime-apply.cpp b/lib/icinga/scheduleddowntime-apply.cpp index af5812304..bbdf7a66e 100644 --- a/lib/icinga/scheduleddowntime-apply.cpp +++ b/lib/icinga/scheduleddowntime-apply.cpp @@ -115,7 +115,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const if (vinstances.IsObjectType()) { if (!rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); Array::Ptr arr = vinstances; Array::Ptr arrclone = arr->ShallowClone(); @@ -134,7 +134,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const } } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); Dictionary::Ptr dict = vinstances; diff --git a/lib/icinga/service-apply.cpp b/lib/icinga/service-apply.cpp index 6af43204b..9e6bc6c6a 100644 --- a/lib/icinga/service-apply.cpp +++ b/lib/icinga/service-apply.cpp @@ -103,7 +103,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule) if (vinstances.IsObjectType()) { if (!rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); Array::Ptr arr = vinstances; Array::Ptr arrclone = arr->ShallowClone(); @@ -122,7 +122,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule) } } else if (vinstances.IsObjectType()) { if (rule.GetFVVar().IsEmpty()) - BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di)); + BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di)); Dictionary::Ptr dict = vinstances;