Exception: VisionAPI::TooManyTasksError
- Inherits:
-
RateLimitError
- Object
- StandardError
- Error
- APIError
- RateLimitError
- VisionAPI::TooManyTasksError
- Defined in:
- lib/vision_api/errors.rb
Overview
429 — the account's concurrent async task cap is reached.
A subclass of RateLimitError so rescue RateLimitError keeps working, but deliberately
not in APIError::RETRYABLE_CODES: unlike a rate limit this does not clear on a timer, it clears
when one of your own in-flight tasks finishes. Sleeping in the client would just hold the
slot you are waiting for. Poll or await your outstanding tasks, then resubmit.
Constant Summary
Constants inherited from APIError
Instance Attribute Summary
Attributes inherited from APIError
#code, #details, #headers, #request_id, #status
Instance Method Summary collapse
-
#max_tasks ⇒ Integer?
The cap that was hit, from
details.max.
Methods inherited from RateLimitError
Methods inherited from APIError
Constructor Details
This class inherits a constructor from VisionAPI::APIError
Instance Method Details
#max_tasks ⇒ Integer?
Returns the cap that was hit, from details.max.
114 115 116 117 |
# File 'lib/vision_api/errors.rb', line 114 def max_tasks value = details["max"] value.to_i if value.is_a?(Numeric) end |