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 rewritten = errors.rewrite_traceback(truncated, err)
if rewritten then
return print_err(rewritten)
print_err(rewritten)
else
return print_err(table.concat({
print_err(table.concat({
err,
util.trim(trace)
}, "\n"))
end
return os.exit(1)
else
if cov then
cov:stop()

View File

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