Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve error message for invalid field access
fixes #8769
  • Loading branch information
gunnarbeutner committed Mar 19, 2015
1 parent 1ccc68e commit ab36912
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/config/vmops.hpp
Expand Up @@ -186,7 +186,8 @@ class VMOps

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 {
Object::Ptr object = type->GetPrototype();
Expand All @@ -198,7 +199,7 @@ class VMOps
} while (type);

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
return Empty;
}
Expand Down

0 comments on commit ab36912

Please sign in to comment.