From 0c10d640941c50b197c07ecc2753151628a9bb95 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 24 Sep 2015 08:29:13 +0200 Subject: [PATCH] Fix incorrect error messages for apply-for fixes #10205 --- lib/icinga/dependency-apply.cpp | 4 ++-- lib/icinga/notification-apply.cpp | 4 ++-- lib/icinga/scheduleddowntime-apply.cpp | 4 ++-- lib/icinga/service-apply.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index 2c1d561df..44913cd79 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -119,7 +119,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(); @@ -138,7 +138,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 fb77d6962..e298cb0fc 100644 --- a/lib/icinga/notification-apply.cpp +++ b/lib/icinga/notification-apply.cpp @@ -118,7 +118,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; @@ -136,7 +136,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 426ac717f..59fd4f90e 100644 --- a/lib/icinga/scheduleddowntime-apply.cpp +++ b/lib/icinga/scheduleddowntime-apply.cpp @@ -117,7 +117,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(); @@ -136,7 +136,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 67896d143..07a8a760c 100644 --- a/lib/icinga/service-apply.cpp +++ b/lib/icinga/service-apply.cpp @@ -105,7 +105,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(); @@ -124,7 +124,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;