Merge pull request #15493 from carlocab/fix-nil-message
utils/github/api: fix nil implicit conversion error
This commit is contained in:
commit
8917acac95
@ -60,6 +60,11 @@ module GitHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
NO_CREDENTIALS_MESSAGE = <<~MESSAGE
|
||||||
|
No GitHub credentials found in macOS Keychain, GitHub CLI or the environment.
|
||||||
|
#{GitHub.pat_blurb}
|
||||||
|
MESSAGE
|
||||||
|
|
||||||
# Error when authentication fails.
|
# Error when authentication fails.
|
||||||
class AuthenticationFailedError < Error
|
class AuthenticationFailedError < Error
|
||||||
def initialize(credentials_type, github_message)
|
def initialize(credentials_type, github_message)
|
||||||
@ -83,6 +88,8 @@ module GitHub
|
|||||||
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
|
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
|
||||||
#{Formatter.url("https://github.com/settings/tokens")}
|
#{Formatter.url("https://github.com/settings/tokens")}
|
||||||
EOS
|
EOS
|
||||||
|
when :none
|
||||||
|
NO_CREDENTIALS_MESSAGE
|
||||||
end
|
end
|
||||||
super message.freeze
|
super message.freeze
|
||||||
end
|
end
|
||||||
@ -91,9 +98,7 @@ module GitHub
|
|||||||
# Error when the user has no GitHub API credentials set at all (macOS keychain, GitHub CLI or envvar).
|
# Error when the user has no GitHub API credentials set at all (macOS keychain, GitHub CLI or envvar).
|
||||||
class MissingAuthenticationError < Error
|
class MissingAuthenticationError < Error
|
||||||
def initialize
|
def initialize
|
||||||
message = +"No GitHub credentials found in macOS Keychain, GitHub CLI or the environment.\n"
|
super NO_CREDENTIALS_MESSAGE
|
||||||
message << GitHub.pat_blurb
|
|
||||||
super message
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user