fix: elixir-tools fails to load when latest version check fails #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
elixir-tools.nvim fails to start if the latest version check fails with a non-200 status code (which happens in cases of a rate limit being reached)

For full description see #150
For additional context this was happening to me when I was on a VPN. Since the unauthenticated rate limit relies on IP address, and there are many users on that server, I hit the limit of 60 reqs per hour. This can also happen to someone tweaking their config and re-opening NeoVim a bunch of times.
Changes
This PR does two things:
--fail
switch in thecurl
command that checks the latest version.This makes the command return a non-zero status if the response status is not
2xx.
version check command due to the GitHub unauthenticated rate limit.
With these changes, elixir-tools is usable again, even if the rate limit call returns a non-2xx status code, as long as the user has a version of ElixirLS cached.
Demo
With elixir-tools cache (no notifications and elixir-tools functions correctly):
CleanShot.2023-07-31.at.21.21.23.mp4
With no elixir-tools cache:
CleanShot.2023-07-31.at.21.27.11.mp4