mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
parent
1ccc68e098
commit
ab36912ccd
@ -186,7 +186,8 @@ public:
|
|||||||
|
|
||||||
static inline Value GetPrototypeField(const Value& context, const String& field, bool not_found_error = true, const DebugInfo& debugInfo = DebugInfo())
|
static inline Value GetPrototypeField(const Value& context, const String& field, bool not_found_error = true, const DebugInfo& debugInfo = DebugInfo())
|
||||||
{
|
{
|
||||||
Type::Ptr type = context.GetReflectionType();
|
Type::Ptr ctype = context.GetReflectionType();
|
||||||
|
Type::Ptr type = ctype;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Object::Ptr object = type->GetPrototype();
|
Object::Ptr object = type->GetPrototype();
|
||||||
@ -198,7 +199,7 @@ public:
|
|||||||
} while (type);
|
} while (type);
|
||||||
|
|
||||||
if (not_found_error)
|
if (not_found_error)
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Invalid field name: '" + field + "'", debugInfo));
|
BOOST_THROW_EXCEPTION(ScriptError("Invalid field access (for value of type '" + ctype->GetName() + "'): '" + field + "'", debugInfo));
|
||||||
else
|
else
|
||||||
return Empty;
|
return Empty;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user