aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorMarcus Tillmanns <marcus.tillmanns@qt.io>2024-05-02 11:37:47 +0200
committerMarcus Tillmanns <marcus.tillmanns@qt.io>2024-05-03 05:59:38 +0000
commit30901b86a469e97ec341c0ff214b41ef6f01b19a (patch)
tree6761566f4cb5d2c33f8d52a820bbb9821aa0bde9 /src/plugins/lua
parentc0052746493bec6db1f81da132fd40ad2f0cce85 (diff)
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>
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/bindings/async.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/lua/bindings/async.cpp b/src/plugins/lua/bindings/async.cpp
index b9408002ecb..31b3cbcd362 100644
--- a/src/plugins/lua/bindings/async.cpp
+++ b/src/plugins/lua/bindings/async.cpp
@@ -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)