Exception: IpApiIo::RateLimitError

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

Overview

HTTP 429 — quota exhausted. Exposes the x-ratelimit-* response headers; reset is the unix timestamp when the quota renews. The client never retries.

Instance Attribute Summary collapse

Attributes inherited from Error

#body, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: 429, body: nil, limit: nil, remaining: nil, reset: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



21
22
23
24
25
26
# File 'lib/ipapi_io/errors.rb', line 21

def initialize(message, status_code: 429, body: nil, limit: nil, remaining: nil, reset: nil)
  super(message, status_code: status_code, body: body)
  @limit = limit
  @remaining = remaining
  @reset = reset
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



19
20
21
# File 'lib/ipapi_io/errors.rb', line 19

def limit
  @limit
end

#remainingObject (readonly)

Returns the value of attribute remaining.



19
20
21
# File 'lib/ipapi_io/errors.rb', line 19

def remaining
  @remaining
end

#resetObject (readonly)

Returns the value of attribute reset.



19
20
21
# File 'lib/ipapi_io/errors.rb', line 19

def reset
  @reset
end