Class: OpenAIError<M>
lib/openai.OpenAIError
Represents an error that occurs when making an OpenAI API call.
Type parameters
Name | Type |
---|---|
M | extends OpenAIMethod |
Hierarchy
↳
OpenAIError
Constructors
constructor
• new OpenAIError<M
>(response
, method
, responseText
, errorCode
)
Type parameters
Name | Type |
---|---|
M | extends OpenAIMethod |
Parameters
Name | Type |
---|---|
response | Response |
method | M |
responseText | string |
errorCode | number |
Overrides
Defined in
packages/ai-jsx/src/lib/openai.tsx:200
Properties
blame
• Readonly
blame: ErrorBlame
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:66
code
• Readonly
code: ErrorCode
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:65
errorCode
• Readonly
errorCode: number
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:108
errorResponse
• Readonly
errorResponse: null
| Record
<string
, any
>
Defined in
packages/ai-jsx/src/lib/openai.tsx:198
metadata
• Readonly
metadata: Jsonifiable
= {}
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:67
statusCode
• Readonly
statusCode: number
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:107
responseBody
• Optional
Readonly
responseBody: string
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:109
responseHeaders
• Optional
Readonly
responseHeaders: Record
<string
, string
>
Inherited from
Defined in
packages/ai-jsx/src/core/errors.ts:110
Methods
toString
▸ toString(): string
Returns
string