MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_exit_error

Function dfhack_exit_error

library/LuaTools.cpp:696–704  ·  view source on GitHub ↗

replaces os.exit with a thrown exception

Source from the content-addressed store, hash-verified

694
695// replaces os.exit with a thrown exception
696static 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
706static int dfhack_exception_tostring(lua_State *L)
707{

Callers

nothing calls this directly

Calls 2

lua_pushfstringFunction · 0.85
dfhack_errorFunction · 0.85

Tested by

no test coverage detected