Exception: Anvil::RateLimitError

Inherits:
APIError show all
Defined in:
lib/anvil/errors.rb

Instance Attribute Summary collapse

Attributes inherited from APIError

#errors, #status_code

Attributes inherited from Error

#code, #response

Instance Method Summary collapse

Constructor Details

#initialize(message, response = nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



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

def initialize(message, response = nil)
  super
  @retry_after = response&.fetch('retry-after', nil)&.to_i if response
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



61
62
63
# File 'lib/anvil/errors.rb', line 61

def retry_after
  @retry_after
end