mirror of https://github.com/Hilbis/Hilbish
fix: use error code if err is ExecError
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…
Reference in New Issue