[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Error handling in C
- From: Reuben Thomas <rrt@...>
- Date: Wed, 15 Oct 2003 10:55:34 +0200 (CEST)
> >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