diff --git a/src/awesomewm.d.tl/utils.tl b/src/awesomewm.d.tl/utils.tl index a0453a5..828070e 100644 --- a/src/awesomewm.d.tl/utils.tl +++ b/src/awesomewm.d.tl/utils.tl @@ -58,12 +58,12 @@ function utils.do_or_fail(func: function(...: any): (T | nil, string), ... local ok, res, err = pcall(func, ...) - if not (ok and res) then + if not ok then log:error(logger.message_with_metadata("do_or_fail failed!", { error = err })) error(err) end - return res + return res as T -- promote to T since pcall succeeded at this point end return utils