sol2
sol2 copied to clipboard
sol::protected_function It won't take over the exception
try
{
sol::state& lua = *sol;
sol::protected_function func = lua["xxxxxxxxx"];
if (!func.valid() || !func.is<sol::protected_function>())
{
return false;
}
sol::protected_function_result result = func.call();
return result;
}
catch (const sol::error& ex)
{
}
can't take over exceptions, because an exception in it returns to the following exception module
try
{
lua.script();
}
catch (const sol::error& ex)
{
}