lua-users home
lua-l archive

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

I have a couple of questions regarding error handling of Lua 5 from a host application:

How can I go about handling errors that occur in the lua_dofile function? If the function fails, it outputs to stderr (which I'd like to prevent) and provides no indication that failure has occurred. Is there any way I can suppress the output of the error message, discover whether an error occurred, and retrieve the error string that would normally be written to the console upon failure?

The functions that I expose to my Lua environment from the host app do error checking. Currently, if a function is called incorrectly (with bad arguments), all I can do is report that an error has occurred -- I can't tell which line in which function caused the error. Is there any way to get this information?