square_api_client/models/enums/
error_category.rs

1//! Model for ErrorCategory enum
2
3use serde::{Deserialize, Serialize};
4
5/// Indicates which high-level category of error has occurred during a request to the Connect API.
6#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
7#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
8pub enum ErrorCategory {
9    /// An error occurred with the Connect API itself.
10    ApiError,
11    /// An authentication error occurred. Most commonly, the request had a missing, malformed, or
12    /// otherwise invalid `Authorization` header.
13    AuthenticationError,
14    /// The request was invalid. Most commonly, a required parameter was missing, or a provided
15    /// parameter had an invalid value.
16    InvalidRequestError,
17    /// Your application reached the Square API rate limit. You might receive this error if your
18    /// application sends a high number of requests to Square APIs in a short period of time.
19    ///
20    /// Your application should monitor responses for `429 RATE_LIMITED` errors and use a retry
21    /// mechanism with an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)
22    /// schedule to resend the requests at an increasingly slower rate. It is also a good practice
23    /// to use a randomized delay (jitter) in your retry schedule.
24    RateLimitError,
25    /// An error occurred while processing a payment method. Most commonly, the details of the
26    /// payment method were invalid (such as a card's CVV or expiration date).
27    PaymentMethodError,
28    /// An error occurred while attempting to process a refund.
29    RefundError,
30    /// An error occurred when checking a merchant subscription status
31    MerchantSubscriptionError,
32}