MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / call_exception_handler

Function call_exception_handler

extlibs/sol3/include/sol/sol.hpp:7436–7450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7434 }
7435
7436 inline int call_exception_handler(lua_State* L, optional<const std::exception&> maybe_ex, string_view what) {
7437 lua_getglobal(L, default_exception_handler_name());
7438 type t = static_cast<type>(lua_type(L, -1));
7439 if (t != type::lightuserdata) {
7440 lua_pop(L, 1);
7441 return default_exception_handler(L, std::move(maybe_ex), std::move(what));
7442 }
7443 void* vfunc = lua_touserdata(L, -1);
7444 lua_pop(L, 1);
7445 if (vfunc == nullptr) {
7446 return default_exception_handler(L, std::move(maybe_ex), std::move(what));
7447 }
7448 exception_handler_function exfunc = reinterpret_cast<exception_handler_function>(vfunc);
7449 return exfunc(L, std::move(maybe_ex), std::move(what));
7450 }
7451
7452#ifdef SOL_NO_EXCEPTIONS
7453 template <lua_CFunction f>

Callers 4

static_trampolineFunction · 0.85
catchFunction · 0.85
trampolineFunction · 0.85

Calls 4

lua_getglobalFunction · 0.85
lua_typeFunction · 0.85
lua_touserdataFunction · 0.85

Tested by

no test coverage detected