sal-modular/vault/src/error.rs

22 lines
551 B
Rust

//! Error types for the vault crate
#[derive(Debug, thiserror::Error)]
pub enum VaultError {
#[error("Storage error: {0}")]
Storage(String),
#[error("Crypto error: {0}")]
Crypto(String),
#[error("Unauthorized")]
Unauthorized,
#[error("Keyspace not found: {0}")]
KeyspaceNotFound(String),
#[error("Key not found: {0}")]
KeyNotFound(String),
#[error("Invalid password")]
InvalidPassword,
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Other: {0}")]
Other(String),
}