# Struct prelude::HostError

> What the host refused, mirroring the protocol's error codes.

`zaun_bot::prelude::HostError` · Struct

```rust
pub struct HostError { … }
```

What the host refused, mirroring the protocol's error codes.

## Fields

### `code: String`

`FORBIDDEN`, `NOT_FOUND`, `BAD_REQUEST`, `RATE_LIMITED`, `CONFLICT`,
`PAYLOAD_TOO_LARGE`, `NOT_GRANTED` (a capability the bot lacks), `UNSUPPORTED`
(this host does not implement the call or this case of it yet), ...

### `detail: Option<String>`

The `reason` or `field` the host gave, if any.

### `retry_after_ms: Option<u64>`

For `RATE_LIMITED` and `BUSY`.

## Methods

### `is_unsupported`

```rust
pub fn is_unsupported(&self) -> bool
```

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.

## Trait implementations

`Clone`, `Debug`, `Display`, `Error`

[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/bindings/zaun/bot/types/struct.HostError.html)
