[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question about error handling
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 12 Mar 2002 10:06:43 -0300
>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
If it is in C, you'll have to call lua_getstack and then lua_getinfo.
--lhf