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:
parent
55e879bd02
commit
a8435b649d
@ -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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user