# HttpError

Defined in: [sdk/js/src/api.ts:109](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L109)

Why `http.fetch` failed (`not-granted`, `refused-address`, `invalid-url`, `timeout`, …).

## Extends

- [`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)

## Constructors

### Constructor

> **new HttpError**(`kind`, `detail?`): `HttpError`

Defined in: [sdk/js/src/api.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L110)

#### Parameters

##### kind

`string`

##### detail?

`string`

#### Returns

`HttpError`

#### Overrides

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`constructor`](/docs/reference/js/zaun-bot/classes/zaunerror/#constructor)

## Properties

### code

> `readonly` **code**: `string`

Defined in: [sdk/js/src/errors.ts:8](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L8)

The protocol error code, or a runtime code such as `NOT_GRANTED`.

#### Inherited from

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`code`](/docs/reference/js/zaun-bot/classes/zaunerror/#code)

***

### detail

> `readonly` **detail**: `string`

Defined in: [sdk/js/src/errors.ts:10](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L10)

The `reason` or `field` the host gave.

#### Inherited from

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`detail`](/docs/reference/js/zaun-bot/classes/zaunerror/#detail)

***

### kind

> `readonly` **kind**: `string`

Defined in: [sdk/js/src/api.ts:110](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/api.ts#L110)

***

### retryAfterMs

> `readonly` **retryAfterMs**: `number`

Defined in: [sdk/js/src/errors.ts:12](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L12)

For `RATE_LIMITED` and `BUSY`: when to try again, in ms.

#### Inherited from

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`retryAfterMs`](/docs/reference/js/zaun-bot/classes/zaunerror/#retryafterms)

## Methods

### isUnsupported()

> **isUnsupported**(): `boolean`

Defined in: [sdk/js/src/errors.ts:27](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L27)

Whether the host does not implement this call (or this case of it) yet: an older host, or a
feature it lacks, such as volume without an Opus encoder. Fall back to what the bot did
before; trying again will not help.

#### Returns

`boolean`

#### Inherited from

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`isUnsupported`](/docs/reference/js/zaun-bot/classes/zaunerror/#isunsupported)

***

### from()

> `static` **from**(`e`): [`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)

Defined in: [sdk/js/src/errors.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/errors.ts#L32)

From the WIT `host-error`.

#### Parameters

##### e

`HostError`

#### Returns

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/)

#### Inherited from

[`ZaunError`](/docs/reference/js/zaun-bot/classes/zaunerror/).[`from`](/docs/reference/js/zaun-bot/classes/zaunerror/#from)
