replaces os.exit with a thrown exception
| 694 | |
| 695 | // replaces os.exit with a thrown exception |
| 696 | static int dfhack_exit_error(lua_State *L) |
| 697 | { |
| 698 | int exit_code = luaL_checkint(L, 1); |
| 699 | lua_pop(L, 1); |
| 700 | lua_pushfstring(L, |
| 701 | "prevented execution of os.exit(%d); please use error()" |
| 702 | " or qerror() instead.", exit_code); |
| 703 | return dfhack_error(L); |
| 704 | } |
| 705 | |
| 706 | static int dfhack_exception_tostring(lua_State *L) |
| 707 | { |
nothing calls this directly
no test coverage detected