Exception: Hookdeck::RateLimitError

Inherits:
ApiError show all
Defined in:
lib/hookdeck/errors.rb

Instance Attribute Summary collapse

Attributes inherited from ApiError

#data, #handled, #message, #request_id, #response, #status

Attributes inherited from Error

#message, #request_id

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RateLimitError

Returns a new instance of RateLimitError.



97
98
99
100
101
# File 'lib/hookdeck/errors.rb', line 97

def initialize(response)
  super
  @status = 429
  @retry_after = response&.dig(:headers, 'retry-after')&.to_i
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



95
96
97
# File 'lib/hookdeck/errors.rb', line 95

def retry_after
  @retry_after
end