lua-users home
lua-l archive

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

Tony Finch <> 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

(Anyway, Lua is not supposed to have problems with my scripts...;-)

cheers  thomasl

web :