aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/core/async/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/core/async/init.lua')
-rw-r--r--lua/nvim-lsp-installer/core/async/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/nvim-lsp-installer/core/async/init.lua b/lua/nvim-lsp-installer/core/async/init.lua
index 1dd2c138..e9c753d2 100644
--- a/lua/nvim-lsp-installer/core/async/init.lua
+++ b/lua/nvim-lsp-installer/core/async/init.lua
@@ -17,7 +17,7 @@ function Promise:_wrap_resolver_cb(success, cb)
return
end
self.has_resolved = true
- cb(success, ...)
+ cb(success, { ... })
end
end
@@ -26,7 +26,11 @@ function Promise:__call(callback)
end
local function await(resolver)
- return co.yield(Promise.new(resolver))
+ local ok, value = co.yield(Promise.new(resolver))
+ if not ok then
+ error(value[1], 2)
+ end
+ return unpack(value)
end
local function table_pack(...)