lua-users home
lua-l archive

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


> If Lua had a hook that is called whenever an error is about to be thrown,
> you could do something like the following:
> ...
>         debug.sethook( error_hook, "e" )

This may also be useful for debugging. Right now Lua-level debugger
doesn't allow for "break on error" functionality. It used to be the
case that debug.traceback was triggered by Lua before the error was
thrown, which allowed for some access to Lua state, but it's no longer
the case with Lua 5.2+.

I think it would fit with the current set of debug hooks (assuming the
error message can be retrieved from debug.traceback or maybe a new
debug.getinfo field).

Paul.