mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
fix: Display a warning but continue execution when dumping an exception and unable to find related issues
Occasionally, when failing to `brew install` or `brew upgrade` a formula, users will get an error message and the last line of it will be: ``` Error: Validation Failed: [{"message"=>"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource"=>"Search", "field"=>"q", "code"=>"invalid"}] ``` Here's an old public example: https://gitlab.com/tabos/rogerrouter/-/issues/21 At Square, this error can be caused by a transient issue with a user's GitHub credentials. My proposal is that any error which prevents `brew` from showing related issues should: 1. Not cause `brew` to exit early (vs. printing diagnostic checks and doing any other cleanup) 2. Be clearly differentiated from the original failure (so it doesn't become a red herring for users troubleshooting their broken formula)
This commit is contained in:
parent
abd1b48e91
commit
461f49dcb6
@ -490,8 +490,8 @@ class BuildError < RuntimeError
|
|||||||
sig { returns(T::Array[T.untyped]) }
|
sig { returns(T::Array[T.untyped]) }
|
||||||
def fetch_issues
|
def fetch_issues
|
||||||
GitHub.issues_for_formula(formula.name, tap: formula.tap, state: "open", type: "issue")
|
GitHub.issues_for_formula(formula.name, tap: formula.tap, state: "open", type: "issue")
|
||||||
rescue GitHub::API::RateLimitExceededError => e
|
rescue GitHub::API::Error => e
|
||||||
opoo e.message
|
opoo "Unable to query GitHub for recent issues on the tap\n#{e.message}"
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user