From: Gunnar Beutner Date: Fri, 1 Feb 2013 13:45:55 +0000 (+0100) Subject: Removed assert()s in ConfigItemBuilder::Compile. X-Git-Tag: v0.0.2~594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c0a6a22074c3472bb71889e3631706a54e5c21a;p=icinga2 Removed assert()s in ConfigItemBuilder::Compile. --- diff --git a/lib/config/configitembuilder.cpp b/lib/config/configitembuilder.cpp index 70963bcec..ce27dc782 100644 --- a/lib/config/configitembuilder.cpp +++ b/lib/config/configitembuilder.cpp @@ -82,8 +82,17 @@ void ConfigItemBuilder::AddExpressionList(const ExpressionList::Ptr& exprl) ConfigItem::Ptr ConfigItemBuilder::Compile(void) { - assert(!m_Type.IsEmpty()); - assert(!m_Name.IsEmpty()); + if (m_Type.IsEmpty()) { + stringstream msgbuf; + msgbuf << "The type name of an object may not be empty: " << m_DebugInfo; + throw_exception(invalid_argument(msgbuf.str())); + } + + if (m_Name.IsEmpty()) { + stringstream msgbuf; + msgbuf << "The name of an object may not be empty: " << m_DebugInfo; + throw_exception(invalid_argument(msgbuf.str())); + } ExpressionList::Ptr exprl = boost::make_shared();