Topic: Reset of errors in Lua, how?
Hello! I did not understand Something how to return errors in Lua from C-shnyh functions? As I understood, the number which is returned C-shnaja by function is an amount of returned values, in a stack. Dug out int lua_error (lua_State *L); int luaL_error (lua_State *L, const char *fmt...); Generates a Lua error, using the value at the top of the stack as the error object. This function does a long jump, and therefore never returns (see luaL_error). But here something is not pleasant to me selected - I at me the project, any jumps are not necessary to me. I need to return an error so that Lua stopped operation and returned an error in that code, the interpreter whence was caused. Tried to return from functions the negative values - Lua continues to work, and about an error only if this result is used further: some_fn () - works someVar = some_fn () message ("Result:". someVar, 1) - here an error [string "..." ]:3: attempt to concatenate a nil value (global ' someVar ') How to be?