Exception: Anakin::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/anakin/errors.rb

Overview

429 — rate limited after the SDK exhausted its retry budget.

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #status

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RateLimitError.



36
37
38
39
# File 'lib/anakin/errors.rb', line 36

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

Instance Attribute Details

#retry_afterObject (readonly)

Seconds the API asked the client to wait, or 0 if the header was absent.



34
35
36
# File 'lib/anakin/errors.rb', line 34

def retry_after
  @retry_after
end