Exception: ScrapeUnblocker::PaymentRequiredError

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

Overview

The account has a billing problem (HTTP 402).

Credentials are fine - the request was stopped for a billing reason. There are three, each raised as a dedicated subclass: QuotaExceededError, CreditLimitExceededError and PaymentFailedError. Rescue this base class to handle all three.

When more than one applies, the most serious wins: failed payment outranks credit limit, which outranks quota. All three lift by themselves once the billing state changes - access returns within roughly a minute, with no key change needed. Like a 401, a 402 is refused before anything is scraped, so it is never billed. Retrying is pointless; fix the billing state first.

Instance Attribute Summary

Attributes inherited from APIError

#body, #status_code

Method Summary

Methods inherited from APIError

#initialize

Constructor Details

This class inherits a constructor from ScrapeUnblocker::APIError