lua-users home
lua-l archive

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


> >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?
>
> Yes, redefine _ALERT.

While we're on this subject, I'd like to re-ask a related question from
last month, which I had the foolishness to ask in an announcement.

Is there a way to stop the lua standalone program producing the error
message "(error with no message)"? I want to be able to call error(false)
in my programs and produce no error, because neither _ALERT nor _TRACEBACK
affects this, and as far as I can see from the lua.c code, there's no way
of changing that (indeed, I changed it myself).

-- 
http://www.mupsych.org/~rrt/ | aphorism, n.  a wise lie