Exception: Fathom::RateLimitError
- Defined in:
- lib/fathom/errors.rb
Overview
Raised when rate limit is exceeded (429)
Instance Attribute Summary collapse
-
#rate_limit_remaining ⇒ Object
readonly
Returns the value of attribute rate_limit_remaining.
-
#rate_limit_reset ⇒ Object
readonly
Returns the value of attribute rate_limit_reset.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, response: nil, http_status: nil, headers: {}) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
Constructor Details
#initialize(message = nil, response: nil, http_status: nil, headers: {}) ⇒ RateLimitError
Returns a new instance of RateLimitError.
25 26 27 28 29 |
# File 'lib/fathom/errors.rb', line 25 def initialize( = nil, response: nil, http_status: nil, headers: {}) @rate_limit_remaining = headers["RateLimit-Remaining"]&.to_i @rate_limit_reset = headers["RateLimit-Reset"]&.to_i super(, response: response, http_status: http_status) end |
Instance Attribute Details
#rate_limit_remaining ⇒ Object (readonly)
Returns the value of attribute rate_limit_remaining.
23 24 25 |
# File 'lib/fathom/errors.rb', line 23 def rate_limit_remaining @rate_limit_remaining end |
#rate_limit_reset ⇒ Object (readonly)
Returns the value of attribute rate_limit_reset.
23 24 25 |
# File 'lib/fathom/errors.rb', line 23 def rate_limit_reset @rate_limit_reset end |