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

Function default_exception_handler

extlibs/sol3/include/sol/sol.hpp:7426–7434  ·  view source on GitHub ↗

must push at least 1 object on the stack

Source from the content-addressed store, hash-verified

7424
7425 // must push at least 1 object on the stack
7426 inline int default_exception_handler(lua_State* L, optional<const std::exception&>, string_view what) {
7427#if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS
7428 std::cerr << "[sol3] An exception occurred: ";
7429 std::cerr.write(what.data(), what.size());
7430 std::cerr << std::endl;
7431#endif
7432 lua_pushlstring(L, what.data(), what.size());
7433 return 1;
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());

Callers 1

call_exception_handlerFunction · 0.85

Calls 4

lua_pushlstringFunction · 0.85
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected