fix: use error code if err is ExecError

snail
sammyette 2024-12-29 01:44:24 -04:00
parent 55e879bd02
commit a8435b649d
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 0 deletions

View File

@ -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())
}
}