[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_pcall error handler
- From: <phil@...>
- Date: Thu, 9 Jan 2003 04:36:03 -0000
Thanks! I've followed the example in lua.c, and it seems to work. I have just
two questions. Firstly, what is lua_pushliteral? I've done this using
lua_getglobal. Any reason not to? And secondly, to do this I've had to use the
dblib, but I'm not sure I want to give my users access to it. Is there any way
to prevent them from using it? Would something like just setting the global
'debug' to nil work?
Thanks, Philip Bock
Luiz Henrique de Figueiredo <email@example.com> said:
> >Can anyone point me to an example of how to get a stack traceback using an
> >error handler and lua_pcall?
> The standard traceback you get in the standalone interpreter when an
> error happens is output using this scheme (of course!). See lcall in
> lua.c in Lua 5.0 (beta). It runs code by setting the value of the
> global variable _TRACEBACK as an error handler. The debug library sets
> _TRACEBACK (see errorfb in ldblib.c).