Skip to main content

void_crypto/
error.rs

1//! Error types for void-crypto.
2
3use thiserror::Error;
4
5/// Result type for void-crypto operations.
6pub type CryptoResult<T> = std::result::Result<T, CryptoError>;
7
8/// Errors that can occur in void-crypto.
9#[derive(Debug, Error)]
10pub enum CryptoError {
11    #[error("encryption error: {0}")]
12    Encryption(String),
13
14    #[error("decryption error: {0}")]
15    Decryption(String),
16
17    #[error("invalid key: {0}")]
18    InvalidKey(String),
19
20    #[error("serialization error: {0}")]
21    Serialization(String),
22
23    #[error("operation requires root key (not available in content-key mode)")]
24    ReadOnlyVault,
25}