From e5f9efd87a8e3d983e04b4fcb7d1fff5d534c764 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 31 Jan 2025 18:09:31 +0300 Subject: [PATCH] fix: error message is not included in coroutine error alert --- res/scripts/stdlib.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 9d29b873..47094bc7 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -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 @@ -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)