cellar_core/
error.rs

1use thiserror::Error;
2
3/// contains all the errors used in cellar-core.
4#[derive(Error, Debug)]
5pub enum CellarError {
6    #[error("{0}")]
7    Argon2Error(#[from] argon2::Error),
8    #[error("Invalid Nonce: {0}")]
9    InvalidChacha20Nonce(String),
10    #[error("{0}")]
11    Base64DecodeError(#[from] base64::DecodeError),
12    #[error("{0}")]
13    IOError(#[from] std::io::Error),
14    #[error("{0}")]
15    ConvertError(#[from] std::array::TryFromSliceError),
16    #[error("{0}")]
17    InvalidKey(String),
18    #[error("{0}")]
19    InvalidKeypair(#[from] ed25519_compact::Error),
20    #[error("Serialize cert error: {0}")]
21    CertEncodeError(#[from] bincode::error::EncodeError),
22    #[error("Deserialize cert error: {0}")]
23    CertDecodeError(#[from] bincode::error::DecodeError),
24    #[error("Certify error: {0}")]
25    CertifyError(#[from] certify::CertifyError),
26    #[error("Rcgen error: {0}")]
27    RcgenError(#[from] rcgen::RcgenError),
28    #[error("unknown error")]
29    Unknown,
30}