Skip to content

Commit

Permalink
fix: error message is not included in coroutine error alert
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jan 31, 2025
1 parent b00160e commit e5f9efd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions res/scripts/stdlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,9 @@ end

function start_coroutine(chunk, name)
local co = coroutine.create(function()
local status, error = xpcall(chunk, function(...)
gui.alert(debug.traceback(), function()
local status, error = xpcall(chunk, function(err)
local fullmsg = "error: "..string.match(err, ": (.+)").."\n"..debug.traceback()
gui.alert(fullmsg, function()
if world.is_open() then
__vc_app.close_world()
else
Expand All @@ -429,7 +430,7 @@ function start_coroutine(chunk, name)
menu.page = "main"
end
end)
return ...
return fullmsg
end)
if not status then
debug.error(error)
Expand Down

0 comments on commit e5f9efd

Please sign in to comment.