class HttpClientError
extends Error
Since 0.1.0

Thrown by IHttpClient.request() when the server returns a non-2xx status.

TBody is the parsed error payload. It defaults to unknown, so the bare name HttpClientError keeps meaning exactly what it did and every existing catch (e) { if (e instanceof HttpClientError) … } is unaffected. A generated client narrows it through its own per-operation error guard, which is how a document's declared 4xx schemas reach the caller — the throw site itself cannot know which operation it is serving.

Constructors

HttpClientError(
message: string,
status: number,
headers: Headers,
body: TBody
)

Type Parameters

TBody = unknown

The parsed error response body.

Properties

readonly
body: TBody
readonly
headers: Headers
readonly
status: number

Usage

import { HttpClientError } from "sdk/src/index.ts";