Re: Overriding debug.traceback

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 17 Mar 2014 11:56:59 -0700

Hi Mike,

>> I see that Lua 5.2.3 is also ignoring debug.traceback...
> Well, yes, for the same reason why LuaJIT does it. Lua 5.2
> introduced luaL_traceback() and LuaJIT has it, too.
> So there's no reason anymore to tediously resolve debug.traceback
> and invoke it as a separate function. That caused trouble in some
> complex error scenarios or when the debug library was removed.

What are the alternatives to catch run-time errors from the Lua side
for chunks you didn't load? For example, the user can initiate
debugging anywhere in their code and it's convenient to be able to
break into the debugger when a run-time error happens. The only way I
could find to support that was to provide a custom debug.traceback
function, but it seems like it's not going to work with either LuaJIT
or Lua5.2. Can you suggest any other mechanism? Thank you.

Paul.

Other related posts: