Exception: XeroKiwi::RateLimitError

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

Instance Attribute Summary collapse

Attributes inherited from APIError

#body, #status

Instance Method Summary collapse

Constructor Details

#initialize(status, body, retry_after: nil, problem: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



28
29
30
31
32
# File 'lib/xero_kiwi/errors.rb', line 28

def initialize(status, body, retry_after: nil, problem: nil)
  @retry_after = retry_after
  @problem     = problem
  super(status, body, "Xero rate limit hit (#{problem || "unknown"}); retry after #{retry_after}s")
end

Instance Attribute Details

#problemObject (readonly)

Returns the value of attribute problem.



26
27
28
# File 'lib/xero_kiwi/errors.rb', line 26

def problem
  @problem
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



26
27
28
# File 'lib/xero_kiwi/errors.rb', line 26

def retry_after
  @retry_after
end