Skip to content

Commit d6f5173

Browse files
committed
feat: better error message on download fail
1 parent 5e2e217 commit d6f5173

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: lua/devdocs/docs.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,15 @@ M.DownloadDocs = function(slug, callback)
119119
local downloadLink = M.ConstructDownloadLink(slug)
120120
vim.system({
121121
'curl',
122-
'-s',
122+
'-sS',
123123
downloadLink,
124124
}, { text = false }, function(res)
125-
assert(res.code == 0, 'Error downloading docs')
125+
if res.code ~= 0 then
126+
vim.schedule(function()
127+
vim.notify('Error downloading doc for ' .. slug .. ': ' .. res.stderr)
128+
end)
129+
return
130+
end
126131
vim.system({
127132
'jq',
128133
'-c',

0 commit comments

Comments
 (0)