Exception: GitHub::RateLimitExceededError Private
- Defined in:
- Library/Homebrew/utils/github.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Error when the API rate limit is exceeded.
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(reset, github_message) ⇒ RateLimitExceededError
constructor
private
A new instance of RateLimitExceededError.
- #pretty_ratelimit_reset(reset) ⇒ Object private
Constructor Details
#initialize(reset, github_message) ⇒ RateLimitExceededError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RateLimitExceededError.
41 42 43 44 45 46 47 48 49 |
# File 'Library/Homebrew/utils/github.rb', line 41 def initialize(reset, ) @github_message = super <<~EOS GitHub API Error: #{} Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token: #{ALL_SCOPES_URL} #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")} EOS end |
Instance Method Details
#pretty_ratelimit_reset(reset) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
51 52 53 |
# File 'Library/Homebrew/utils/github.rb', line 51 def pretty_ratelimit_reset(reset) pretty_duration(Time.at(reset) - Time.now) end |