Exception: VisionAPI::InsufficientCreditsError

Inherits:
APIError
  • Object
show all
Defined in:
lib/vision_api/errors.rb

Overview

402 — the account does not hold enough credits. Never retried: it cannot succeed.

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 APIError

#initialize, #retryable?

Constructor Details

This class inherits a constructor from VisionAPI::APIError

Instance Method Details

#availableInteger?

Returns the balance at the time of the refusal.

Returns:

  • (Integer, nil)

    the balance at the time of the refusal



70
# File 'lib/vision_api/errors.rb', line 70

def available = details["available"]

#requiredInteger?

Returns the credit cost of the request that was refused.

Returns:

  • (Integer, nil)

    the credit cost of the request that was refused



67
# File 'lib/vision_api/errors.rb', line 67

def required = details["required"]