diff --git a/Source/LuaBridge/detail/CFunctions.h b/Source/LuaBridge/detail/CFunctions.h index f4cb416..ac092a7 100644 --- a/Source/LuaBridge/detail/CFunctions.h +++ b/Source/LuaBridge/detail/CFunctions.h @@ -191,16 +191,7 @@ struct CFunc */ static int readOnlyError(lua_State* L) noexcept { - try - { - std::string s; - s = s + "'" + lua_tostring(L, lua_upvalueindex(1)) + "' is read-only"; - return luaL_error(L, s.c_str()); - } - catch (...) - { - return luaL_error(L, "Property is read-only"); - } + return luaL_error(L, "'%s' is read-only'", lua_tostring(L, lua_upvalueindex(1))); } //----------------------------------------------------------------------------