| 39 | } |
| 40 | |
| 41 | int main() { |
| 42 | std::cout << "=== exception_handler ===" << std::endl; |
| 43 | |
| 44 | sol::state lua; |
| 45 | lua.open_libraries(sol::lib::base); |
| 46 | lua.set_exception_handler(&my_exception_handler); |
| 47 | |
| 48 | lua.set_function("will_throw", &will_throw); |
| 49 | |
| 50 | sol::protected_function_result pfr = lua.safe_script( |
| 51 | "will_throw()", &sol::script_pass_on_error); |
| 52 | |
| 53 | SOL_ASSERT(!pfr.valid()); |
| 54 | |
| 55 | sol::error err = pfr; |
| 56 | std::cout << err.what() << std::endl; |
| 57 | |
| 58 | std::cout << std::endl; |
| 59 | |
| 60 | return 0; |
| 61 | } |
nothing calls this directly
no test coverage detected