Skip to main content

ps_datachunk/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum DataChunkError {
5    #[error(transparent)]
6    Decryption(#[from] ps_cypher::DecryptionError),
7    #[error(transparent)]
8    Encryption(#[from] ps_cypher::EncryptionError),
9    #[error(transparent)]
10    Hash(#[from] ps_hash::HashError),
11    #[error("The hash of a chunk was incorrect")]
12    HashMismatch,
13    #[error("Rkyv deserialization failed")]
14    InvalidArchive,
15    #[error("Rkyv serialization failed")]
16    Serialization,
17}
18
19pub type Result<T> = std::result::Result<T, DataChunkError>;