mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
1b21faeb5d
commit
827de21907
@ -21,7 +21,6 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "config/i2-config.hpp"
|
||||
#include "config/configitembuilder.hpp"
|
||||
#include "config/configcompiler.hpp"
|
||||
#include "config/expression.hpp"
|
||||
#include "config/applyrule.hpp"
|
||||
|
@ -79,14 +79,14 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
|
||||
{
|
||||
if (m_Type.IsEmpty()) {
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "The type name of an object may not be empty: " << m_DebugInfo;
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
|
||||
msgbuf << "The type name of an object may not be empty";
|
||||
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), m_DebugInfo));
|
||||
}
|
||||
|
||||
if (!DynamicType::GetByName(m_Type)) {
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "The type '" + m_Type + "' is unknown: " << m_DebugInfo;
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
|
||||
msgbuf << "The type '" + m_Type + "' is unknown";
|
||||
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), m_DebugInfo));
|
||||
}
|
||||
|
||||
if (m_Name.FindFirstOf("!") != String::NPos) {
|
||||
|
@ -105,8 +105,7 @@ bool CreateObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& r
|
||||
status = "Object could not be created.";
|
||||
|
||||
Array::Ptr errors = new Array();
|
||||
BOOST_FOREACH(const boost::exception_ptr& ex, upq.GetExceptions())
|
||||
{
|
||||
BOOST_FOREACH(const boost::exception_ptr& ex, upq.GetExceptions()) {
|
||||
errors->Add(DiagnosticInformation(ex));
|
||||
}
|
||||
result1->Set("errors", errors);
|
||||
|
Loading…
x
Reference in New Issue
Block a user