Skip to content

Class: ApiError

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ApiError

Class: ApiError

Defined in: src/errors.ts:24

HTTP API error (4xx/5xx response from the backend).

Carries the HTTP status code, parsed response body, and response headers.

Extends

Extended by

Constructors

Constructor

new ApiError(message, status, body, headers, errorCode?): ApiError

Defined in: src/errors.ts:36

Parameters

message

string

status

number

body

unknown

headers

Headers

errorCode?

string

Returns

ApiError

Overrides

ReasoningLayerError.constructor

Properties

body

readonly body: unknown

Defined in: src/errors.ts:32

Parsed response body.


cause?

optional cause: unknown

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from

ReasoningLayerError.cause


errorCode

readonly errorCode: string | undefined

Defined in: src/errors.ts:30

Backend error code (from response body error field), if present.


headers

readonly headers: Headers

Defined in: src/errors.ts:34

Response headers.


message

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

ReasoningLayerError.message


name

name: string = 'ApiError'

Defined in: src/errors.ts:25

Overrides

ReasoningLayerError.name


stack?

optional stack: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

ReasoningLayerError.stack


status

readonly status: number

Defined in: src/errors.ts:28

HTTP status code.