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