lua-users home
lua-l archive

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

On May 10, 2006, at 10:51, Robert Hibberdine wrote:

How do I print the function name and line number where the error occurred in my own error handler?

In general, you can always discover such information using debug.getinfo():

        local someInfo = debug.getinfo( 3, "Sn" )
        local aClass = someInfo.source
        local aMethod =

There is also a handy debug.traceback to use in conjunction with xpcall:


PA, Onnay Equitursay