mirror of https://github.com/Icinga/icinga2.git
Don't use exceptions in CommentProcessor::Get*.
Fixes 3595
This commit is contained in:
parent
768fd50703
commit
15b260d75e
|
@ -66,7 +66,7 @@ void CommentProcessor::RemoveComment(const String& id)
|
||||||
DynamicObject::Ptr owner = GetOwnerByCommentID(id);
|
DynamicObject::Ptr owner = GetOwnerByCommentID(id);
|
||||||
|
|
||||||
if (!owner)
|
if (!owner)
|
||||||
throw_exception(invalid_argument("Comment ID does not exist."));
|
return;
|
||||||
|
|
||||||
Dictionary::Ptr comments = owner->Get("comments");
|
Dictionary::Ptr comments = owner->Get("comments");
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ String CommentProcessor::GetIDFromLegacyID(int id)
|
||||||
map<int, String>::iterator it = m_LegacyCommentCache.find(id);
|
map<int, String>::iterator it = m_LegacyCommentCache.find(id);
|
||||||
|
|
||||||
if (it == m_LegacyCommentCache.end())
|
if (it == m_LegacyCommentCache.end())
|
||||||
throw_exception(invalid_argument("Invalid legacy comment ID specified."));
|
return Empty;
|
||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ Dictionary::Ptr CommentProcessor::GetCommentByID(const String& id)
|
||||||
DynamicObject::Ptr owner = GetOwnerByCommentID(id);
|
DynamicObject::Ptr owner = GetOwnerByCommentID(id);
|
||||||
|
|
||||||
if (!owner)
|
if (!owner)
|
||||||
throw_exception(invalid_argument("Comment ID does not exist."));
|
return Dictionary::Ptr();
|
||||||
|
|
||||||
Dictionary::Ptr comments = owner->Get("comments");
|
Dictionary::Ptr comments = owner->Get("comments");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue