Update Library/Homebrew/utils/github/api.rb

Co-authored-by: Rylan Polster <rslpolster@gmail.com>
This commit is contained in:
Logicer 2021-07-20 12:06:04 +10:00 committed by GitHub
parent ed4f840a67
commit 7beb1f227c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ module GitHub
class RateLimitExceededError < Error
def initialize(reset, github_message)
@github_message = github_message
new_pat_message = API.credentials ? "" : ", or:\n#{CREATE_GITHUB_PAT_MESSAGE}"
new_pat_message = ", or:\n#{CREATE_GITHUB_PAT_MESSAGE}" if API.credentials.blank?
super <<~EOS
GitHub API Error: #{github_message}
Try again in #{pretty_ratelimit_reset(reset)}#{new_pat_message}