fix(util): Util.try can now work without an error message

This commit is contained in:
Folke Lemaitre 2023-01-05 11:31:13 +01:00
parent 847ef091fa
commit e4f79a42d6
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ function M.try(fn, opts)
end
level = level + 1
end
msg = msg .. "\n\n" .. err
msg = (msg and (msg .. "\n\n") or "") .. err
if #trace > 0 then
msg = msg .. "\n\n# stacktrace:\n" .. table.concat(trace, "\n")
end