# Класс: InferenceClientProviderApiError

Возникает, если HTTP-запрос к провайдеру не выполняется, например, из-за проблем с API или ошибок сервера.

## Иерархия

- `InferenceClientHttpRequestError`

  ↳ **`InferenceClientProviderApiError`**

## Конструкторы

### constructor

• **new InferenceClientProviderApiError**(`message`, `httpRequest`, `httpResponse`): [`InferenceClientProviderApiError`](InferenceClientProviderApiError)

#### Параметры[[constructor.parameters]]

| Имя | Тип |
| :------ | :------ |
| `message` | `string` |
| `httpRequest` | `HttpRequest` |
| `httpResponse` | `HttpResponse` |

#### Возвращает[[constructor.returns]]

[`InferenceClientProviderApiError`](InferenceClientProviderApiError)

#### Переопределения[[constructor.overrides]]

InferenceClientHttpRequestError.constructor

#### Определено в[[constructor.defined-in]]

[inference/src/errors.ts:65](https://github.com/huggingface/huggingface.js/blob/main/packages/inference/src/errors.ts#L65)

## Свойства

### причина

• `Optional` **причина**: `unknown`

#### Наследуется от[[cause.inherited-from]]

InferenceClientHttpRequestError.cause

#### Определено в[[cause.defined-in]]

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26

___

### httpRequest

• **httpRequest**: `HttpRequest`

#### Наследуется от[[httprequest.inherited-from]]

InferenceClientHttpRequestError.httpRequest

#### Определено в[[httprequest.defined-in]]

[inference/src/errors.ts:41](https://github.com/huggingface/huggingface.js/blob/main/packages/inference/src/errors.ts#L41)

___

### httpResponse

• **httpResponse**: `HttpResponse`

#### Наследуется от[[httpresponse.inherited-from]]

InferenceClientHttpRequestError.httpResponse

#### Определено в[[httpresponse.defined-in]]

[inference/src/errors.ts:42](https://github.com/huggingface/huggingface.js/blob/main/packages/inference/src/errors.ts#L42)

___

### сообщение

• **message**: `string`

#### Наследуется от[[message.inherited-from]]

InferenceClientHttpRequestError.message

#### Определено в[[message.defined-in]]

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077

___

### name

• **name**: `string`

#### Наследуется от[[name.inherited-from]]

InferenceClientHttpRequestError.name

#### Определено в[[name.defined-in]]

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1076

___

### стек

• `Optional` **стек**: `string`

#### Наследуется от[[stack.inherited-from]]

InferenceClientHttpRequestError.stack

#### Определено в[[stack.defined-in]]

doc-internal/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1078

___

### prepareStackTrace

▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`

Необязательное переопределение для форматирования трассировок стека

**`See`**

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

#### Объявление типа[[preparestacktrace.type-declaration]]

▸ (`err`, `stackTraces`): `any`

##### Параметры[[preparestacktrace.parameters]]

| Имя | Тип |
| :------ | :------ |
| `err` | `Error` |
| `stackTraces` | `CallSite`[] |

##### Возвращает[[preparestacktrace.returns]]

`any`

#### Наследуется от[[preparestacktrace.inherited-from]]

InferenceClientHttpRequestError.prepareStackTrace

#### Определено в[[preparestacktrace.defined-in]]

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:11

___

### stackTraceLimit

▪ `Static` **stackTraceLimit**: `number`

#### Наследуется от[[stacktracelimit.inherited-from]]

InferenceClientHttpRequestError.stackTraceLimit

#### Определено в[[stacktracelimit.defined-in]]

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:13

## Методы

### captureStackTrace

▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`

Создание свойства .stack на целевом объекте

#### Параметры[[capturestacktrace.parameters]]

| Имя | Тип |
| :------ | :------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

#### Возвращает[[capturestacktrace.returns]]

`void`

#### Наследуется от[[capturestacktrace.inherited-from]]

InferenceClientHttpRequestError.captureStackTrace

#### Определено в[[capturestacktrace.defined-in]]

inference/node_modules/.pnpm/@types+node@18.13.0/node_modules/@types/node/globals.d.ts:4

