lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Title: luaL_error from a lua_sethook function?


I was surprised at finding that (unless I'm mistaken) it's not possible to catch a luaL_error thrown from a lua_sethook function.

The script contains a pcall around several lines of code.
The line hook function calls luaL_error inside of these lines.
I would expect the control flow to work like an exception, propagating up to the pcall, getting handled, and then continuing onward.
Instead, the control flow seems to go directly up to the top luaL_dostring.

Is this how things are supposed to work? Was it mentioned in the documentation somewhere?