From 30901b86a469e97ec341c0ff214b41ef6f01b19a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 2 May 2024 11:37:47 +0200 Subject: [PATCH] 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 --- src/plugins/lua/bindings/async.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)