MCPcopy Create free account
hub / github.com/ThePhD/sol2 / catch

Method catch

include/sol/protected_function.hpp:371–375  ·  view source on GitHub ↗

LuaJIT cannot have the catchall when the safe propagation is on but LuaJIT will swallow all C++ errors if we don't at least catch std::exception ones

Source from the content-addressed store, hash-verified

369 // but LuaJIT will swallow all C++ errors
370 // if we don't at least catch std::exception ones
371 catch (...) {
372 detail::handle_protected_exception(lua_state(), optional<const std::exception&>(nullopt), detail::protected_function_error, h);
373 firstreturn = lua_gettop(lua_state());
374 return protected_function_result(lua_state(), firstreturn, 0, 1, call_status::runtime);
375 }
376#endif // Always catch edge case
377#else
378 // do not handle exceptions: they can be propogated into C++ and keep all type information / rich information

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected