Exception: Rospatent::Errors::RateLimitError
- Defined in:
- lib/rospatent/errors.rb
Overview
Raised when API rate limit is exceeded
Instance Attribute Summary collapse
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
Attributes inherited from ApiError
#request_id, #response_body, #status_code
Instance Method Summary collapse
-
#initialize(message, status_code = 429, retry_after = nil) ⇒ RateLimitError
constructor
Initialize a new rate limit error.
- #to_s ⇒ Object
Methods inherited from ApiError
Constructor Details
#initialize(message, status_code = 429, retry_after = nil) ⇒ RateLimitError
Initialize a new rate limit error
57 58 59 60 |
# File 'lib/rospatent/errors.rb', line 57 def initialize(, status_code = 429, retry_after = nil) @retry_after = retry_after super(, status_code) end |
Instance Attribute Details
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
51 52 53 |
# File 'lib/rospatent/errors.rb', line 51 def retry_after @retry_after end |
Instance Method Details
#to_s ⇒ Object
62 63 64 65 66 |
# File 'lib/rospatent/errors.rb', line 62 def to_s msg = super msg += " Retry after #{@retry_after} seconds." if @retry_after msg end |