debug(lua): __log сообщения внутри pcall fn

Чтобы увидеть РЕАЛЬНУЮ ошибку Lua-handler (раньше pcall глотал её).
This commit is contained in:
min 2026-06-09 10:04:45 +03:00
parent 6ce296570d
commit eae2ad7cc5

View File

@ -1748,11 +1748,15 @@ export function registerRobloxShim(lua, opts) {
debug.sethook(function() debug.sethook(function()
coroutine.yield(0.016) coroutine.yield(0.016)
end, "", 20000) end, "", 20000)
pcall(fn, a1, a2, a3, a4) local ok, err = pcall(fn, a1, a2, a3, a4)
if not ok then
__log("error", "[handler-fn-error] " .. tostring(err))
end
end) end)
__rbxl_register_coroutine(handlerId, co) __rbxl_register_coroutine(handlerId, co)
local ok, ret = coroutine.resume(co) local ok, ret = coroutine.resume(co)
if not ok then if not ok then
__log("error", "[handler-resume-error] " .. tostring(ret))
__rbxl_send_error(handlerId, tostring(ret)) __rbxl_send_error(handlerId, tostring(ret))
__rbxl_unregister_coroutine(handlerId) __rbxl_unregister_coroutine(handlerId)
elseif type(ret) == 'number' then elseif type(ret) == 'number' then