Skip to main content

rift_core/
error.rs

1//! Core error types shared across identity, invites, and crypto helpers.
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum CoreError {
7    /// I/O failure (file read/write, directory creation, etc).
8    #[error("io error: {0}")]
9    Io(#[from] std::io::Error),
10    /// Serialization/deserialization errors for bincode payloads.
11    #[error("serialization error: {0}")]
12    Bincode(#[from] bincode::Error),
13    /// Noise protocol errors (handshake/transport state).
14    #[error("snow error: {0}")]
15    Snow(#[from] snow::Error),
16    /// Key material length mismatch.
17    #[error("invalid key length")]
18    InvalidKeyLength,
19    /// Identity file missing on disk.
20    #[error("identity not found at {0}")]
21    IdentityMissing(String),
22    /// Config directory could not be discovered.
23    #[error("config directory not found")]
24    ConfigDirMissing,
25    /// Invite could not be parsed or failed validation.
26    #[error("invalid invite")]
27    InvalidInvite,
28}