Skip to content

Commit

Permalink
Fix incorrect error messages for apply-for
Browse files Browse the repository at this point in the history
fixes #10205
  • Loading branch information
gunnarbeutner committed Sep 24, 2015
1 parent aa12a4e commit 0c10d64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/icinga/dependency-apply.cpp
Expand Up @@ -119,7 +119,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR

if (vinstances.IsObjectType<Array>()) {
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();
Expand All @@ -138,7 +138,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR
}
} else if (vinstances.IsObjectType<Dictionary>()) {
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;

Expand Down
4 changes: 2 additions & 2 deletions lib/icinga/notification-apply.cpp
Expand Up @@ -118,7 +118,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl

if (vinstances.IsObjectType<Array>()) {
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;

Expand All @@ -136,7 +136,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl
}
} else if (vinstances.IsObjectType<Dictionary>()) {
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;

Expand Down
4 changes: 2 additions & 2 deletions lib/icinga/scheduleddowntime-apply.cpp
Expand Up @@ -117,7 +117,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const

if (vinstances.IsObjectType<Array>()) {
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();
Expand All @@ -136,7 +136,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
}
} else if (vinstances.IsObjectType<Dictionary>()) {
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;

Expand Down
4 changes: 2 additions & 2 deletions lib/icinga/service-apply.cpp
Expand Up @@ -105,7 +105,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)

if (vinstances.IsObjectType<Array>()) {
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();
Expand All @@ -124,7 +124,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
}
} else if (vinstances.IsObjectType<Dictionary>()) {
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;

Expand Down

0 comments on commit 0c10d64

Please sign in to comment.