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 collapse
- #reset ⇒ Integer readonly private
- #resource ⇒ String readonly private
Instance Method Summary collapse
- #initialize(github_message, reset:, resource:, limit:) ⇒ void constructor private
- #pretty_ratelimit_reset ⇒ String private
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_once, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_incompatible, #pretty_install_status, #pretty_installed, #pretty_removed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Constructor Details
#initialize(github_message, reset:, resource:, limit:) ⇒ void
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.
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'utils/github/api.rb', line 84 def initialize(, reset:, resource:, limit:) @reset = reset @resource = resource = ", or:\n#{GitHub.pat_blurb}" if API.credentials.blank? limit_note = limit ? " (#{limit} limit)" : "" = <<~EOS GitHub API Error: #{} Rate limit exceeded for #{resource} resource#{limit_note}. Try again in #{pretty_ratelimit_reset}#{} EOS super(, ) end |
Instance Attribute Details
#reset ⇒ Integer (readonly)
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.
98 99 100 |
# File 'utils/github/api.rb', line 98 def reset @reset end |
#resource ⇒ String (readonly)
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.
101 102 103 |
# File 'utils/github/api.rb', line 101 def resource @resource end |
Instance Method Details
#pretty_ratelimit_reset ⇒ String
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.
104 105 106 |
# File 'utils/github/api.rb', line 104 def pretty_ratelimit_reset pretty_duration(Time.at(@reset) - Time.now) end |