Exception: FlatApi::FlatRateLimitError

Inherits:
FlatError
  • Object
show all
Defined in:
lib/flat_api/errors.rb

Overview

The account or IP exceeded its request quota. Returned as HTTP 403, not 429.

Instance Attribute Summary collapse

Attributes inherited from FlatError

#body, #code, #headers, #request_id, #status

Instance Method Summary collapse

Methods inherited from FlatError

#to_s

Constructor Details

#initialize(message, **kwargs) ⇒ FlatRateLimitError

Returns a new instance of FlatRateLimitError.



50
51
52
53
54
55
56
# File 'lib/flat_api/errors.rb', line 50

def initialize(message, **kwargs)
  super
  @limit = int_header('X-RateLimit-Limit')
  @remaining = int_header('X-RateLimit-Remaining')
  # UTC epoch seconds at which the window resets. Flat sends no Retry-After header.
  @reset = int_header('X-RateLimit-Reset')
end

Instance Attribute Details

#limit ⇒ Object (readonly)

Returns the value of attribute limit.



48
49
50
# File 'lib/flat_api/errors.rb', line 48

def limit
  @limit
end

#remaining ⇒ Object (readonly)

Returns the value of attribute remaining.



48
49
50
# File 'lib/flat_api/errors.rb', line 48

def remaining
  @remaining
end

#reset ⇒ Object (readonly)

Returns the value of attribute reset.



48
49
50
# File 'lib/flat_api/errors.rb', line 48

def reset
  @reset
end