Exception: X::ClientError

Inherits:
HTTPError show all
Defined in:
x-core/lib/x/core/errors/client_error.rb

Overview

The base class of the errors of a 4xx response, which the API refused

The request is most often the reason it was refused, so sending it again unchanged is refused again. Some are refused for a state that can change: TooManyRequests and RequestTimeout pass once the rate limit resets or the API reads the request in time, PaymentRequired once credit is added, and Conflict once a filtered stream has rules.

Examples:

Tell a request the API refused from a failure of the API

rescue X::ClientError => e
  logger.warn("#{e.status}: #{e.message}")

Constructor Details

This class inherits a constructor from X::HTTPError