Exception: GitHub::API::RateLimitExceededError Private
- Defined in:
- utils/github/api.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
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. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of RateLimitExceededError.
56 57 58 59 60 61 62 63 |
# File 'utils/github/api.rb', line 56 def initialize(reset, ) @github_message = = ", or:\n#{GitHub.pat_blurb}" if API.credentials.blank? super <<~EOS GitHub API Error: #{} Try again in #{pretty_ratelimit_reset(reset)}#{} EOS end |
Instance Method Details
#pretty_ratelimit_reset(reset) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
65 66 67 |
# File 'utils/github/api.rb', line 65 def pretty_ratelimit_reset(reset) pretty_duration(Time.at(reset) - Time.now) end |