[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua.c and OS error codes
- From: Thomas Lauer <thomas.lauer@...>
- Date: Thu, 14 Jun 2007 10:34:28 +0100
Tony Finch <dot@dotat.at> wrote:
> > A 'return 1453' in a Lua main chunk doesn't set the error code that's
> > handed back to the OS. It would be nice if utility scripts could set
> > this value.
>
> I wrote some very similar code for my specialized lua wrapper yesterday,
> so I agree that it's useful :-) I'd suggest amending your patch to set
> s.errcode to EXIT_FAILURE if the (lua error) status is non-zero.
I thought of that, but for the time being decided against. Main reason
was that external tools can't easily distinguish between a non-zero code
that means "lua has a problem with my script" (i.e. lua error status<>0)
vs "my script has a problem with whatever" (i.e. my error code<>0). And
whatever I do, I can construct cases where doing the opposite would be
better.
(Anyway, Lua is not supposed to have problems with my scripts...;-)
--
cheers thomasl
web : http://thomaslauer.com/start