Lua: Add more error output

We were missing error message when the error occurred
during a.sync(...) calls.

This adds error output in those cases.

Change-Id: If66772b4a71bb909aff7129243824fc5343c66a1
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-05-02 11:37:47 +02:00
parent c005274649
commit 30901b86a4

View File

@@ -16,6 +16,10 @@ local pong = function(func, callback)
local step = nil
step = function(...)
local stat, ret = co.resume(thread, ...)
if not stat then
print(ret)
print(debug.traceback(thread))
end
assert(stat, ret)
if co.status(thread) == "dead" then
(callback or function() end)(ret)
@@ -65,7 +69,7 @@ local join = function(thunks)
end
-- sugar over coroutine
local await = function(defer)
assert(type(defer) == "function", "type error :: expected func")
assert(type(defer) == "function", "type error :: expected func :: was: " .. type(defer))
return co.yield(defer)
end
local await_all = function(defer)