Improve error message for invalid inline service definitions.

Refs #5846
This commit is contained in:
Gunnar Beutner 2014-03-24 11:23:05 +01:00
parent 4ec939f332
commit 8bfb60b7fa
3 changed files with 15 additions and 1 deletions

View File

@ -157,6 +157,14 @@ void Array::Resize(size_t new_size)
m_Data.resize(new_size);
}
void Array::Clear(void)
{
ASSERT(!OwnsLock());
ObjectLock olock(this);
m_Data.clear();
}
void Array::CopyTo(const Array::Ptr& dest) const
{
ASSERT(!OwnsLock());

View File

@ -56,6 +56,7 @@ public:
void Remove(Iterator it);
void Resize(size_t new_size);
void Clear(void);
void CopyTo(const Array::Ptr& dest) const;
Array::Ptr ShallowClone(void) const;

View File

@ -68,7 +68,12 @@ void AExpression::ExtractPath(const std::vector<String>& path, const Array::Ptr&
AExpression::Ptr exprl = m_Operand2;
if (path.size() == 1) {
VERIFY(exprl->m_Operator == &AExpression::OpDict);
if (m_Operator == &AExpression::OpSet)
result->Clear();
if (exprl->m_Operator != &AExpression::OpDict)
BOOST_THROW_EXCEPTION(ConfigError("The '" + path[0] + "' attribute must be a dictionary.") << errinfo_debuginfo(m_DebugInfo));
Array::Ptr subexprl = exprl->m_Operand1;
ObjectLock olock(subexprl);
BOOST_FOREACH(const AExpression::Ptr& expr, subexprl) {