Skip to content

Commit

Permalink
docs: update mason-errors help section (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Nov 8, 2022
1 parent e0a1ba8 commit 45714c5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
31 changes: 19 additions & 12 deletions doc/mason.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,25 @@ GITHUB MIRROR *mason-download-mirror-github*
==============================================================================
INSTALLATION ERRORS *mason-errors*

*mason-errors-github-api*
For some installers, the GitHub API is used to fetch information about
releases. This API imposes a rate limit that may be triggered, causing
installations to fail. The reasons why a rate limit is triggered are many, for
example being behind a public API, or using other software that also send
requests to the GitHub API.

To circumvent this, mason will utilize the GitHub CLI when
available, leading to API requests being subject to a much higher rate limit
threshold when authenticated. Should you run into errors with communicating
with GitHub's API, it's recommended to install, and authenticate, the GitHub
CLI: https://cli.github.com/.
*mason-provider-errors*
By default, Mason uses the api.mason-registry.dev API to resolve package
metadata. Calling this service may result in network errors on some networks
(e.g., SSL issues on corporate VPNs). If resolving the SSL error is not an
option, you will have to change the provider implementation. Mason provides a
client provider which calls underlying 3rd party service APIs directly, which
you can enable like so:

require("mason").setup {
providers = {
"mason.providers.client",
"mason.providers.registry-api",
}
}

Note: ~
The client provider have less overall coverage and may come with
additional performance penalties (spawning slow commands, network &
parsing overheads, etc.).

==============================================================================
DEBUGGING *mason-debugging*
Expand Down
2 changes: 1 addition & 1 deletion lua/mason-core/managers/github/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function M.release_version(opts)
return client
.fetch_latest_release(opts.repo)
:map(_.prop "tag_name")
:get_or_throw "Failed to fetch latest release from GitHub API. Refer to :h mason-errors-github-api for more information."
:get_or_throw "Failed to fetch latest release from GitHub API. Refer to :h mason-provider-errors for more information."
end)

return {
Expand Down

0 comments on commit 45714c5

Please sign in to comment.