aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/core/async/init.lua8
-rw-r--r--lua/nvim-lsp-installer/process.lua2
2 files changed, 7 insertions, 3 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(...)
diff --git a/lua/nvim-lsp-installer/process.lua b/lua/nvim-lsp-installer/process.lua
index 87a4b950..07d51c32 100644
--- a/lua/nvim-lsp-installer/process.lua
+++ b/lua/nvim-lsp-installer/process.lua
@@ -143,7 +143,7 @@ function M.spawn(cmd, opts, callback)
end
end
check:stop()
- callback(successful)
+ callback(successful, exit_code)
end)
log.fmt_debug("Job pid=%s exited with exit_code=%s, signal=%s", pid_or_err, exit_code, signal)