lua-users home
lua-l archive

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


> When a script aborts, how can I identify the chunk and the line number?

If you mean a Lua script that dies because of an error, then the info you want
is part of the error message left on the top of the stack, assuming you run
Lua in protected mode, that is with a call to lua_cpcall. Otherwise, the
error message is made but lost because the Lua core panics. You may set a
panic function with lua_atpanic; you can't get the error message, but at least
you'll be able to call abort() and load a debugger and see where you were.
--lhf