From a8435b649dc0b6bfd9151d3c8d823c6de2f2461c Mon Sep 17 00:00:00 2001 From: sammyette Date: Sun, 29 Dec 2024 01:44:24 -0400 Subject: [PATCH] fix: use error code if err is ExecError --- golibs/snail/lua.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/golibs/snail/lua.go b/golibs/snail/lua.go index db2ff07..61ca254 100644 --- a/golibs/snail/lua.go +++ b/golibs/snail/lua.go @@ -85,6 +85,9 @@ func srun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { if code, ok := interp.IsExitStatus(err); ok { exitCode = int(code) } else { + if exErr, ok := util.IsExecError(err); ok { + exitCode = exErr.Code + } luaErr = rt.StringValue(err.Error()) } }