lua-users home
lua-l archive

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

In my project, I have patched into luaD_error(), where I intercept scripting errors, add on file and line number information using the code from luaB__ERRORMESSAGE, and then quit the app (code available on request).

If a syntax error occurs in a script this works fine, but if a script tries to call a function that doesn't exist, ie. "attempt to call global 'XXX' (a nil value)", no file/line info is available. That is to say, 'lua_getstack(L, 1, &ar)' returns zero. In this case, is there anyway to get the file/line where the error occurred?