Jazz Turner-Baggs 9a94f9a6d6
Flatten Repos (#70)
* move to “crates” style folder

* Update workspace

* clear crate names

* Rename crate folders based on feedback

* Use workspace dependencies instead of paths

* Move updated files from core
2026-03-24 18:21:00 -07:00

34 lines
998 B
Rust

pub use thiserror::Error;
use storage::StorageError;
#[derive(Error, Debug)]
pub enum ChatError {
#[error("protocol error: {0:?}")]
Protocol(String),
#[error("protocol error: Got {0:?} expected {1:?}")]
ProtocolExpectation(&'static str, String),
#[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(),
#[error("expected a different key length")]
InvalidKeyLength,
#[error("bytes provided to {0} failed")]
BadParsing(&'static str),
#[error("convo with id: {0} was not found")]
NoConvo(String),
#[error("storage error: {0}")]
Storage(#[from] StorageError),
}
#[derive(Error, Debug)]
pub enum EncryptionError {
#[error("decryption: {0}")]
Decryption(String),
}