mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Fix loadVFS error handling
This commit is contained in:
parent
aa4303fc38
commit
550659c2d9
1 changed files with 2 additions and 2 deletions
|
@ -376,7 +376,7 @@ namespace LuaUtil
|
|||
|
||||
sol::protected_function_result LuaState::throwIfError(sol::protected_function_result&& res)
|
||||
{
|
||||
if (!res.valid() && static_cast<int>(res.get_type()) == LUA_TSTRING)
|
||||
if (!res.valid())
|
||||
throw std::runtime_error(std::string("Lua error: ") += res.get<sol::error>().what());
|
||||
else
|
||||
return std::move(res);
|
||||
|
@ -397,7 +397,7 @@ namespace LuaUtil
|
|||
std::string fileContent(std::istreambuf_iterator<char>(*mVFS->get(path)), {});
|
||||
sol::load_result res = mSol.load(fileContent, path, sol::load_mode::text);
|
||||
if (!res.valid())
|
||||
throw std::runtime_error("Lua error: " + res.get<std::string>());
|
||||
throw std::runtime_error(std::string("Lua error: ") += res.get<sol::error>().what());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue