must push at least 1 object on the stack
| 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()); |
no test coverage detected