2025-12-22 09:40:46 -08:00
|
|
|
pub use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
pub enum ChatError {
|
|
|
|
|
#[error("protocol error: {0:?}")]
|
|
|
|
|
Protocol(String),
|
2026-01-29 00:59:07 +07:00
|
|
|
#[error("protocol error: Got {0:?} expected {1:?}")]
|
|
|
|
|
ProtocolExpectation(&'static str, String),
|
2026-01-22 06:39:09 +07:00
|
|
|
#[error("Failed to decode payload: {0}")]
|
|
|
|
|
DecodeError(#[from] prost::DecodeError),
|
|
|
|
|
#[error("incorrect bundle value: {0:?}")]
|
|
|
|
|
UnexpectedPayload(String),
|
|
|
|
|
#[error("unexpected payload contents: {0}")]
|
|
|
|
|
BadBundleValue(String),
|
|
|
|
|
#[error("handshake initiated with a unknown ephemeral key")]
|
|
|
|
|
UnknownEphemeralKey(),
|
2026-01-26 23:53:44 +07:00
|
|
|
#[error("expected a different key length")]
|
|
|
|
|
InvalidKeyLength,
|
|
|
|
|
#[error("bytes provided to {0} failed")]
|
|
|
|
|
BadParsing(&'static str),
|
2025-12-22 09:40:46 -08:00
|
|
|
}
|