lua-users home
lua-l archive

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


----- Original Message -----
From: Paul K
Date: 3/17/2014 1:25 PM
I'd like to move this debug.traceback discussion from LuaJIT maillist
here [1]. debug.traceback used to be the only mechanism to catch
run-time errors for code chunks you didn't load yourself and it
appears that this mechanism is not available in Lua 5.2+ or LuaJIT as
debug.traceback is not called anymore in those cases.

As such we are left without any alternative for catching run-time
errors from the Lua layer. Mike mentioned using a new hook as a
possible solution. Could this be considered as it would definitely
solve the issue of catching the errors?
The Tilde debugger [1] made by Tantalus adds an error hook to catch the location where error() was called from. I'll just throw it out there as an example of something that works pretty well.

Anyway, I'd love to see the hooks, too.

-Josh

[1] https://github.com/jjensen/lua-tilde/blob/master/lib/lua/lua_5.1.3.patch