Improved LuaClass setter error

Former-commit-id: 20de9e0a08fa249a8bd8f8241fb36e0668fe198a
This commit is contained in:
Lynix 2014-04-12 14:06:27 +02:00
parent 55ce80b524
commit 7ccac02bfd
1 changed files with 6 additions and 1 deletions

View File

@ -223,7 +223,12 @@ int NzLuaClass<T>::SetterProxy(lua_State* state)
T& instance = *(*static_cast<T**>(lua.CheckUserdata(1, info->name)));
if (!setter(lua, instance))
lua.Error("Field not found");
{
std::size_t length;
const char* str = lua.Tostring(2, &length);
lua.Error("Class "\"" + info->name + "\" has no field \"" + NzString(str, length) + ')');
}
return 1;
}