aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/async/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mason-core/async/init.lua')
-rw-r--r--lua/mason-core/async/init.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/mason-core/async/init.lua b/lua/mason-core/async/init.lua
index 05401ca2..3c88eef0 100644
--- a/lua/mason-core/async/init.lua
+++ b/lua/mason-core/async/init.lua
@@ -29,7 +29,7 @@ end
local function await(resolver)
local ok, value = co.yield(Promise.new(resolver))
if not ok then
- error(value[1], 2)
+ error(value[1], 0)
end
return unpack(value)
end
@@ -38,8 +38,10 @@ local function table_pack(...)
return { n = select("#", ...), ... }
end
----@param async_fn fun(...)
+---@generic T
+---@param async_fn T
---@param should_reject_err boolean? Whether the provided async_fn takes a callback with the signature `fun(err, result)`
+---@return T
local function promisify(async_fn, should_reject_err)
return function(...)
local args = table_pack(...)