Exception: OmniSocials::RateLimitError

Inherits:
APIError
  • Object
show all
Defined in:
lib/omnisocials/errors.rb

Overview

429 - rate limit exceeded (100 requests per minute).

#retry_after is the number of seconds to wait before retrying, taken from the Retry-After header (or the body's retry_after field) when present.

Instance Attribute Summary collapse

Attributes inherited from APIError

#body, #code, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, status: 429, code: nil, body: nil, retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



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

def initialize(message, status: 429, code: nil, body: nil, retry_after: nil)
  super(message, status: status, code: code, body: body)
  @retry_after = retry_after
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



57
58
59
# File 'lib/omnisocials/errors.rb', line 57

def retry_after
  @retry_after
end