lua-users home
lua-l archive

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


On Tue, Mar 12, 2002 at 10:06:43AM -0300, Luiz Henrique de Figueiredo wrote:
> >After some searching, I have also succeeded in installing a custom
> >error handler function, but I do not succeed in finding out how to
> >obtain the line number of the error for which the function gets called.
> 
> If your error handler is in Lua, try something like this:
> 
> function _ERRORMESSAGE(s)
>  print(s)
>  local a=getinfo(2)
>  print(a.short_src,a.currentline,a.name)
> end

Along the same lines... is there an easy way to get a string containing the
stack backtrace that I think the debugging library's default error handler
generates from a error handler written in Lua?

-- 
Rob Kendrick - http://www.digital-scurf.org/
You will be held hostage by a radical group.