Exception: Spaceship::TooManyRequestsError

Inherits:
BasicPreferredInfoError show all
Defined in:
spaceship/lib/spaceship/errors.rb

Overview

Raised when 429 is received from App Store Connect

Constant Summary

Constants inherited from BasicPreferredInfoError

BasicPreferredInfoError::TITLE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicPreferredInfoError

#preferred_error_info

Methods inherited from StandardError

#exit_status

Methods inherited from Exception

#fastlane_should_report_metrics?

Constructor Details

#initialize(resp_hash) ⇒ TooManyRequestsError

Returns a new instance of TooManyRequestsError.



51
52
53
54
55
56
57
58
# File 'spaceship/lib/spaceship/errors.rb', line 51

def initialize(resp_hash)
  headers = resp_hash[:response_headers] || {}
  @retry_after = (headers['retry-after'] || 60).to_i
  @rate_limit_user = headers['x-daiquiri-rate-limit-user']
  message = 'Apple 429 detected'
  message += " - #{rate_limit_user}" if rate_limit_user
  super(message)
end

Instance Attribute Details

#rate_limit_userObject (readonly)

Returns the value of attribute rate_limit_user.



49
50
51
# File 'spaceship/lib/spaceship/errors.rb', line 49

def rate_limit_user
  @rate_limit_user
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



48
49
50
# File 'spaceship/lib/spaceship/errors.rb', line 48

def retry_after
  @retry_after
end

Instance Method Details

#show_github_issuesObject



60
61
62
# File 'spaceship/lib/spaceship/errors.rb', line 60

def show_github_issues
  false
end