Exception: Html2img::InsufficientCreditsError
- Defined in:
- lib/html2img/errors.rb
Overview
Raised on a 402: authenticated, but out of credits for the period.
The API code is insufficient_credits.
Instance Attribute Summary
Attributes inherited from Error
#error_code, #payload, #status_code
Instance Method Summary collapse
-
#credits_remaining ⇒ Integer?
Credits left on the account.
Methods inherited from Error
Constructor Details
This class inherits a constructor from Html2img::Error
Instance Method Details
#credits_remaining ⇒ Integer?
Returns credits left on the account. Zero on a 402.
41 42 43 44 45 |
# File 'lib/html2img/errors.rb', line 41 def credits_remaining value = payload["credits_remaining"] value.is_a?(Integer) ? value : nil end |