Exception: TrueTrial::RateLimitError

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

Overview

Raised when the rate limit is exceeded (HTTP 429).

Instance Attribute Summary collapse

Attributes inherited from Error

#response_body, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message = "Rate limit exceeded", retry_after: nil, response_body: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



43
44
45
46
# File 'lib/truetrial/errors.rb', line 43

def initialize(message = "Rate limit exceeded", retry_after: nil, response_body: nil)
  @retry_after = retry_after
  super(message, status_code: 429, response_body: response_body)
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



41
42
43
# File 'lib/truetrial/errors.rb', line 41

def retry_after
  @retry_after
end