diff options
| author | William Boman <william@redwill.se> | 2022-04-11 14:48:04 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2022-04-11 14:59:09 +0200 |
| commit | 50f5ce660fa2898685c365344321fcadaeeab717 (patch) | |
| tree | 164eadd04f1cde4307be59b578b1e058deb04ec9 /lua | |
| parent | make install context available via coroutine context (#586) (diff) | |
| download | mason-50f5ce660fa2898685c365344321fcadaeeab717.tar mason-50f5ce660fa2898685c365344321fcadaeeab717.tar.gz mason-50f5ce660fa2898685c365344321fcadaeeab717.tar.bz2 mason-50f5ce660fa2898685c365344321fcadaeeab717.tar.lz mason-50f5ce660fa2898685c365344321fcadaeeab717.tar.xz mason-50f5ce660fa2898685c365344321fcadaeeab717.tar.zst mason-50f5ce660fa2898685c365344321fcadaeeab717.zip | |
fix(spawn): fix Failure.tostring when unable to retrieve uv_handle
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/core/spawn.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/core/spawn.lua b/lua/nvim-lsp-installer/core/spawn.lua index 4776ff66..8ac06aa4 100644 --- a/lua/nvim-lsp-installer/core/spawn.lua +++ b/lua/nvim-lsp-installer/core/spawn.lua @@ -24,7 +24,11 @@ local spawn = { local function Failure(err, cmd) return Result.failure(setmetatable(err, { __tostring = function() - return ("spawn: %s failed with exit code %d"):format(cmd, err.exit_code) + if err.exit_code ~= nil then + return ("spawn: %s failed with exit code %d. %s"):format(cmd, err.exit_code, err.stderr or "") + else + return ("spawn: %s failed with no exit code. %s"):format(cmd, err.stderr or "") + end end, })) end |
