[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to get lua error stack in c++
- From: Rici Lake <lua@...>
- Date: Thu, 7 Dec 2006 12:17:54 -0500
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.