Skip to content

HttpError

Defined in: packages/fetch-kit/src/errors.ts:48

Thrown when the server responds with a non-2xx status.

The full Response object is preserved so callers can read headers, stream the body, or re-handle as needed.

new HttpError(status, statusText, response, body): HttpError

Defined in: packages/fetch-kit/src/errors.ts:51

number

string

Response

unknown

HttpError

FetchKitError.constructor

readonly body: unknown

Defined in: packages/fetch-kit/src/errors.ts:55


readonly name: "HttpError" = "HttpError"

Defined in: packages/fetch-kit/src/errors.ts:49

FetchKitError.name


readonly response: Response

Defined in: packages/fetch-kit/src/errors.ts:54


readonly status: number

Defined in: packages/fetch-kit/src/errors.ts:52


readonly statusText: string

Defined in: packages/fetch-kit/src/errors.ts:53

get isClientError(): boolean

Defined in: packages/fetch-kit/src/errors.ts:61

Returns true for 4xx errors (client errors).

boolean


get isServerError(): boolean

Defined in: packages/fetch-kit/src/errors.ts:66

Returns true for 5xx errors (server errors).

boolean