Skip to main content

Class: ApiError

Defined in: apiError.ts:74

A non-2xx REST answer, thrown by apiCall and by the callApi of @ttoss/http-server-mcp-openapi. A tool registered with registerTools that lets it escape answers apiErrorResult: the text line plus the envelope as structuredContent, so a client reads the error code without parsing a string.

Extends​

  • Error

Constructors​

Constructor​

new ApiError(__namedParameters): ApiError

Defined in: apiError.ts:81

Parameters​

ParameterType
__namedParametersApiErrorParams

Returns​

ApiError

Overrides​

Error.constructor

Properties​

[API_ERROR]​

readonly [API_ERROR]: true = true

Defined in: apiError.ts:79


body​

readonly body: unknown

Defined in: apiError.ts:78

The parsed response body, undefined when it was not JSON.


status​

readonly status: number

Defined in: apiError.ts:76

The HTTP status the REST API answered.