From 45714c54fb61a61c74724f64ca3f728c30ae01d2 Mon Sep 17 00:00:00 2001 From: William Boman Date: Tue, 8 Nov 2022 13:32:13 +0100 Subject: docs: update mason-errors help section (#646) --- doc/mason.txt | 31 +++++++++++++++++++------------ lua/mason-core/managers/github/init.lua | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/doc/mason.txt b/doc/mason.txt index 3a3a9ac6..d16dbc40 100644 --- a/doc/mason.txt +++ b/doc/mason.txt @@ -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* diff --git a/lua/mason-core/managers/github/init.lua b/lua/mason-core/managers/github/init.lua index 5f1df1ec..e9e4ec67 100644 --- a/lua/mason-core/managers/github/init.lua +++ b/lua/mason-core/managers/github/init.lua @@ -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 { -- cgit v1.2.3-70-g09d2