lua-users home
lua-l archive

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



On 7-Dec-06, at 7:36 AM, Gokul N wrote:

Is there a simple way ,where in we can get the lua error stack(like Xpcall inside lua) from lua api inside our c++ code.

Take a look at the implementation of debug.traceback, which shows how to use the debug/introspection API to produce a traceback.

The fourth argument of lua_pcall allows you to specify an error function which will be called when an error is thrown, before the stack is unwound. The stand-alone Lua interpreter uses debug.traceback as this error function.