Przejdź do głównej zawartości

Variable: ErrorCodes

const ErrorCodes: object

Type Declaration

ABORTED

readonly ABORTED: "ABORTED" = 'ABORTED'

The caller cancelled the request via its AbortSignal — distinct from TIMEOUT (the SDK's own deadline). A cancelled request is never retried.

GRAPHQL_ERROR

readonly GRAPHQL_ERROR: "GRAPHQL_ERROR" = 'GRAPHQL_ERROR'

HTTP_ERROR

readonly HTTP_ERROR: "HTTP_ERROR" = 'HTTP_ERROR'

NETWORK_ERROR

readonly NETWORK_ERROR: "NETWORK_ERROR" = 'NETWORK_ERROR'

NO_DATA

readonly NO_DATA: "NO_DATA" = 'NO_DATA'

NON_JSON_RESPONSE

readonly NON_JSON_RESPONSE: "NON_JSON_RESPONSE" = 'NON_JSON_RESPONSE'

The response body could not be parsed as JSON — most commonly an HTML page substituted by a proxy, a WAF challenge, or an edge block (e.g. Cloudflare) in front of the GraphQL endpoint, rather than an actual GraphQL response. Carries the real HTTP status (this is NOT a network failure — a response was received). See NonJsonResponseDiagnostics for the shape carried in cause. retryMiddleware does not retry this error when status < 500 (a deterministic block/challenge — retrying would hit the same page again); a status >= 500 non-JSON body (e.g. an nginx/load-balancer HTML error page) is treated as transient and retried like any other 5xx.

RATE_LIMITED

readonly RATE_LIMITED: "RATE_LIMITED" = 'RATE_LIMITED'

The request was rate-limited (HTTP 429). Transient: the same request may succeed after the limit window passes — callers MUST treat it as retryable and MUST NOT tear down the session on it (e.g. a refresh rate-limit is not a logout).

SESSION_EXPIRED

readonly SESSION_EXPIRED: "SESSION_EXPIRED" = 'SESSION_EXPIRED'

The customer session expired and could not be renewed (proactive refresh failed on tab wake, or a reactive refresh after a 401 also failed). Surfaced to the consumer so the storefront can prompt re-authentication.

TIMEOUT

readonly TIMEOUT: "TIMEOUT" = 'TIMEOUT'

USER_ERROR

readonly USER_ERROR: "USER_ERROR" = 'USER_ERROR'