Skip to main content

nysiris_core/
error.rs

1/// Errors shared by the Nysiris native core.
2#[derive(Debug, thiserror::Error)]
3pub enum CoreError {
4    #[error("invalid key: {0}")]
5    InvalidKey(String),
6    #[error("invalid input: {0}")]
7    InvalidInput(String),
8    #[error("cryptographic failure: {0}")]
9    Crypto(String),
10    #[error("io failure: {0}")]
11    Io(#[from] std::io::Error),
12    #[error("json failure: {0}")]
13    Json(#[from] serde_json::Error),
14    #[error("transport failure: {0}")]
15    Transport(String),
16    #[error("not found: {0}")]
17    NotFound(String),
18    #[error("history failure: {0}")]
19    History(String),
20}
21
22pub type Result<T> = std::result::Result<T, CoreError>;