# Enum client::ClientError

> A command could not be prepared or the session refuses to send it.

`zaun_community_protocol::client::ClientError` · Enum

```rust
pub enum ClientError { … }
```

A command could not be prepared or the session refuses to send it.

## Variants

### `InvalidBody(BodyError)`

The body breaks a state-free rule; nothing was sent.

### `Serialize`

The body or envelope failed to serialise (never expected for this crate's types).

### `Frame(EncodeError)`

The envelope exceeds its size limit or cannot be framed.

### `TooLarge { len, limit }`

The envelope exceeds the command limit for its type.

### `Rng(RngError)`

The OS random number generator failed.

### `NotReady`

No verified `session.welcome` yet: call `super::Session::hello` and wait.

### `Failed(WelcomeError)`

The welcome failed verification; the session MUST NOT send commands.

### `WrongCommunity`

`community_id` differs from the session's binding.

### `WrongKind(&'static str)`

`super::Session::send_signal` with a non-signal body, or `send` with a signal.

## Trait implementations

`Clone`, `Debug`, `Display`, `Eq`, `Error`, `From<EncodeError>`, `From<RngError>`, `PartialEq`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/client/error/enum.ClientError.html)
