exit with error code when code run with moon fails

This commit is contained in:
leaf corcoran 2019-09-26 10:25:01 -07:00
parent 29a780ecc4
commit dba4b10a45
2 changed files with 4 additions and 2 deletions

View File

@ -97,13 +97,14 @@ run = function()
local truncated = errors.truncate_traceback(util.trim(trace)) local truncated = errors.truncate_traceback(util.trim(trace))
local rewritten = errors.rewrite_traceback(truncated, err) local rewritten = errors.rewrite_traceback(truncated, err)
if rewritten then if rewritten then
return print_err(rewritten) print_err(rewritten)
else else
return print_err(table.concat({ print_err(table.concat({
err, err,
util.trim(trace) util.trim(trace)
}, "\n")) }, "\n"))
end end
return os.exit(1)
else else
if cov then if cov then
cov:stop() cov:stop()

View File

@ -90,6 +90,7 @@ run = ->
err, err,
util.trim trace util.trim trace
}, "\n" }, "\n"
os.exit 1
else else
if cov if cov
cov\stop! cov\stop!