Skip to main content
zerotal

Documentation


Documentation / zerotal / client / ApiClientError

Class: ApiClientError

Defined in: packages/client/src/errors.ts:9

Thrown for any non-2xx HTTP response.

body is the raw response text. For 422 validation failures the more specific ValidationError subclass is thrown instead, exposing the parsed field errors.

Extends

Extended by

Constructors

Constructor

new ApiClientError(status, statusText, body, headers?): ApiClientError

Defined in: packages/client/src/errors.ts:13

Parameters

status

number

statusText

string

body

string

headers?

Headers

Returns

ApiClientError

Overrides

ZerotalError.constructor

Properties

headers

readonly headers: Headers | undefined

Defined in: packages/client/src/errors.ts:11

Response headers, when available (used for Retry-After, rate-limit info, etc.).


statusText

readonly statusText: string

Defined in: packages/client/src/errors.ts:15


body

readonly body: string

Defined in: packages/client/src/errors.ts:16


code

readonly code: string

Defined in: packages/core/src/errors/ZerotalError.ts:18

Inherited from

ZerotalError.code


status

readonly status: number = 500

Defined in: packages/core/src/errors/ZerotalError.ts:19

Inherited from

ZerotalError.status


context?

readonly optional context?: Record<string, unknown>

Defined in: packages/core/src/errors/ZerotalError.ts:20

Inherited from

ZerotalError.context

Accessors

retryAfterMs

Get Signature

get retryAfterMs(): number | null

Defined in: packages/client/src/errors.ts:28

Parsed Retry-After (seconds or HTTP-date) in milliseconds, or null when absent.

Returns

number | null