Skip to content

Commit de6d046

Browse files
authored
fix: elixir-tools does not load when Github Rate Limit reached (#151)
See #150
1 parent 883933b commit de6d046

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/elixir/utils.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function M.latest_release(owner, repo, opts)
3737
local github_host = opts.github_host or "api.github.com"
3838
local cache_dir = opts.cache_dir or "~/.cache/nvim/elixir-tools.nvim/"
3939
local curl = string.format(
40-
[[curl --silent -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://%s/repos/%s/%s/releases/latest]],
40+
[[curl --fail --silent -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://%s/repos/%s/%s/releases/latest]],
4141
github_host,
4242
owner,
4343
repo
@@ -63,7 +63,10 @@ function M.latest_release(owner, repo, opts)
6363
vim.notify(
6464
"Failed to fetch the current "
6565
.. repo
66-
.. " version from GitHub or the cache. You most likely do not have an internet connection and have no cached version of the language server."
66+
.. " version from GitHub or the cache.\n"
67+
.. "You most likely do not have an internet connection / exceeded\n"
68+
.. "the GitHub rate limit, and have no cached version of the language\n"
69+
.. "server."
6770
)
6871

6972
return nil

0 commit comments

Comments
 (0)