From: Gunnar Beutner Date: Thu, 31 Jan 2013 15:23:02 +0000 (+0100) Subject: Don't use exceptions in CommentProcessor::Get*. X-Git-Tag: v0.0.2~602 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15b260d75e378c0167a993e3a9b9fea4b973d87b;p=icinga2 Don't use exceptions in CommentProcessor::Get*. Fixes 3595 --- diff --git a/lib/icinga/commentprocessor.cpp b/lib/icinga/commentprocessor.cpp index 33423b94c..d6aa23999 100644 --- a/lib/icinga/commentprocessor.cpp +++ b/lib/icinga/commentprocessor.cpp @@ -66,7 +66,7 @@ void CommentProcessor::RemoveComment(const String& id) DynamicObject::Ptr owner = GetOwnerByCommentID(id); if (!owner) - throw_exception(invalid_argument("Comment ID does not exist.")); + return; Dictionary::Ptr comments = owner->Get("comments"); @@ -81,7 +81,7 @@ String CommentProcessor::GetIDFromLegacyID(int id) map::iterator it = m_LegacyCommentCache.find(id); if (it == m_LegacyCommentCache.end()) - throw_exception(invalid_argument("Invalid legacy comment ID specified.")); + return Empty; return it->second; } @@ -98,7 +98,7 @@ Dictionary::Ptr CommentProcessor::GetCommentByID(const String& id) DynamicObject::Ptr owner = GetOwnerByCommentID(id); if (!owner) - throw_exception(invalid_argument("Comment ID does not exist.")); + return Dictionary::Ptr(); Dictionary::Ptr comments = owner->Get("comments");