Re: adding errorcodes on luajit.exe failures

  • From: Mike Pall <mike-1409@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 9 Sep 2014 12:46:32 +0200

Stefan Hett wrote:
> I see from the code-base that in case of an error LuaJIT (aka:
> pmain) doesn't return any errorcodes at all.

That's not true. A simple test could have shown you that before
posting. If you throw an error to the top level or use os.exit(n),
it *does* set the error code (POSIX shell examples):

$ luajit -e ''; echo $?
0

$ luajit -e 'error("foo")' 2>/dev/null; echo $?
1

$ luajit -e 'os.exit(42)'; echo $?
42

--Mike

Other related posts: