2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-27 16:03:23 +00:00

fix: use error code if err is ExecError

This commit is contained in:
sammyette 2024-12-29 01:44:24 -04:00
parent 55e879bd02
commit a8435b649d
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -85,6 +85,9 @@ func srun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if code, ok := interp.IsExitStatus(err); ok { if code, ok := interp.IsExitStatus(err); ok {
exitCode = int(code) exitCode = int(code)
} else { } else {
if exErr, ok := util.IsExecError(err); ok {
exitCode = exErr.Code
}
luaErr = rt.StringValue(err.Error()) luaErr = rt.StringValue(err.Error())
} }
} }