Skip to main content

Class: OpenAIError<M>

lib/openai.OpenAIError

Represents an error that occurs when making an OpenAI API call.

Type parameters

NameType
Mextends OpenAIMethod

Hierarchy

Constructors

constructor

new OpenAIError<M>(response, method, responseText, errorCode)

Type parameters

NameType
Mextends OpenAIMethod

Parameters

NameType
responseResponse
methodM
responseTextstring
errorCodenumber

Overrides

HttpError.constructor

Defined in

packages/ai-jsx/src/lib/openai.tsx:188

Properties

blame

Readonly blame: ErrorBlame

Inherited from

HttpError.blame

Defined in

packages/ai-jsx/src/core/errors.ts:58


code

Readonly code: ErrorCode

Inherited from

HttpError.code

Defined in

packages/ai-jsx/src/core/errors.ts:57


errorCode

Readonly errorCode: number

Inherited from

HttpError.errorCode

Defined in

packages/ai-jsx/src/core/errors.ts:100


errorResponse

Readonly errorResponse: null | Record<string, any>

Defined in

packages/ai-jsx/src/lib/openai.tsx:186


metadata

Readonly metadata: Jsonifiable = {}

Inherited from

HttpError.metadata

Defined in

packages/ai-jsx/src/core/errors.ts:59


statusCode

Readonly statusCode: number

Inherited from

HttpError.statusCode

Defined in

packages/ai-jsx/src/core/errors.ts:99


responseBody

Optional Readonly responseBody: string

Inherited from

HttpError.responseBody

Defined in

packages/ai-jsx/src/core/errors.ts:101


responseHeaders

Optional Readonly responseHeaders: Record<string, string>

Inherited from

HttpError.responseHeaders

Defined in

packages/ai-jsx/src/core/errors.ts:102

Methods

toString

toString(): string

Returns

string

Inherited from

HttpError.toString

Defined in

packages/ai-jsx/src/core/errors.ts:81