1#[derive(Debug, thiserror::Error)]
8pub enum ScrybeError {
9 #[error("I/O error: {0}")]
10 Io(#[from] std::io::Error),
11 #[error("serialization error: {0}")]
12 Serde(#[from] serde_json::Error),
13 #[error("CBOR encoding error: {0}")]
14 Cbor(String),
15 #[error("invalid content digest: {0}")]
16 InvalidDigest(String),
17 #[error("{0}")]
18 Other(String),
19}
20
21impl ScrybeError {
22 pub fn msg(msg: impl std::fmt::Display) -> Self {
24 Self::Other(msg.to_string())
25 }
26}
27
28pub type Result<T> = std::result::Result<T, ScrybeError>;