From 15b260d75e378c0167a993e3a9b9fea4b973d87b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 31 Jan 2013 16:23:02 +0100 Subject: [PATCH] Don't use exceptions in CommentProcessor::Get*. Fixes 3595 --- lib/icinga/commentprocessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"); -- 2.40.0