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.



66
67
68
69
70
71
72
73
# File 'spaceship/lib/spaceship/errors.rb', line 66

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.



64
65
66
# File 'spaceship/lib/spaceship/errors.rb', line 64

def rate_limit_user
  @rate_limit_user
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



63
64
65
# File 'spaceship/lib/spaceship/errors.rb', line 63

def retry_after
  @retry_after
end

Instance Method Details

#show_github_issuesObject



75
76
77
# File 'spaceship/lib/spaceship/errors.rb', line 75

def show_github_issues
  false
end