Class: Slack::Web::Api::Errors::TooManyRequestsError

Inherits:
Faraday::Error
  • Object
show all
Defined in:
lib/slack/web/api/errors/too_many_requests_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ TooManyRequestsError

Returns a new instance of TooManyRequestsError.



9
10
11
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 9

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 7

def response
  @response
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 13

def message
  "Retry after #{retry_after} seconds"
end

#retry_afterObject



17
18
19
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 17

def retry_after
  response.headers['retry-after'].to_i
end