diff options
| -rw-r--r-- | lua/tasks/module/cargo.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/tasks/module/cargo.lua b/lua/tasks/module/cargo.lua index 8caf6ab..7b17b54 100644 --- a/lua/tasks/module/cargo.lua +++ b/lua/tasks/module/cargo.lua | |||
| @@ -80,15 +80,19 @@ end | |||
| 80 | local function get_cargo_subcommands() | 80 | local function get_cargo_subcommands() |
| 81 | local cargo_subcommands = {} | 81 | local cargo_subcommands = {} |
| 82 | 82 | ||
| 83 | local job = Job:new({ | 83 | local ok, job = pcall(Job.new, Job, { |
| 84 | command = 'cargo', | 84 | command = 'cargo', |
| 85 | args = { '--list' }, | 85 | args = { '--list' }, |
| 86 | enabled_recording = true, | 86 | enabled_recording = true, |
| 87 | }) | 87 | }) |
| 88 | if not ok then | ||
| 89 | utils.notify("Unable to execute 'cargo' command", vim.log.levels.WARN) | ||
| 90 | return {} | ||
| 91 | end | ||
| 88 | job:sync() | 92 | job:sync() |
| 89 | 93 | ||
| 90 | if job.code ~= 0 or job.signal ~= 0 then | 94 | if job.code ~= 0 or job.signal ~= 0 then |
| 91 | utils.notify('Unable to get list of available cargo subcommands', vim.log.levels.ERROR) | 95 | utils.notify('Unable to get list of available cargo subcommands', vim.log.levels.WARN) |
| 92 | return {} | 96 | return {} |
| 93 | end | 97 | end |
| 94 | 98 | ||
