Reduce severity of assert_trap failures

This commit is contained in:
Rerumu 2022-06-23 16:36:38 -04:00
parent 2c6176d538
commit 59a5a3219f
2 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,9 @@ end
local function assert_trap(func, ...)
if pcall(func, ...) then
error("Failed to trap", 2)
local trace = debug.traceback("Failed to trap", 2)
io.stderr:write(trace, '\n')
end
end

View File

@ -48,7 +48,9 @@ end
local function assert_trap(func, ...)
if pcall(func, ...) then
error("Failed to trap", 2)
local trace = debug.traceback("Failed to trap", 2)
print(trace)
end
end