* The outer-most error callback handler for use with lua_pcall(). On * error Lua will call this callback with a single argument that * represents the error value. In most cases this will be a string * containing an error message, but channel programs can use Lua's * error() function to return arbitrary objects as errors. This callback * returns (on the Lua stack) the original error object alo
| 131 | * registered cleanup function here. |
| 132 | */ |
| 133 | static int |
| 134 | zcp_error_handler(lua_State *state) |
| 135 | { |
| 136 | const char *msg; |
| 137 | |
| 138 | zcp_cleanup(state); |
| 139 | |
| 140 | VERIFY3U(1, ==, lua_gettop(state)); |
| 141 | msg = lua_tostring(state, 1); |
| 142 | luaL_traceback(state, state, msg, 1); |
| 143 | return (1); |
| 144 | } |
| 145 | |
| 146 | int |
| 147 | zcp_argerror(lua_State *state, int narg, const char *msg, ...) |
nothing calls this directly
no test coverage detected