Exception: VisionAPI::TooManyTasksError

Inherits:
RateLimitError show all
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

APIError::RETRYABLE_CODES

Instance Attribute Summary

Attributes inherited from APIError

#code, #details, #headers, #request_id, #status

Instance Method Summary collapse

Methods inherited from RateLimitError

#retry_after

Methods inherited from APIError

#initialize, #retryable?

Constructor Details

This class inherits a constructor from VisionAPI::APIError

Instance Method Details

#max_tasksInteger?

Returns the cap that was hit, from details.max.

Returns:

  • (Integer, nil)

    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