1use thiserror;
2use std::result;
3
4pub type Result<T> = result::Result<T, Error>;
6
7#[derive(thiserror::Error, Clone, Debug, PartialEq)]
9pub enum Error {
10 #[error("DecryptionError: {0}")]
12 DecryptionError(String),
13
14 #[error("UnsupportedAlgorithm: {0}")]
16 UnsupportedAlgorithm(i32),
17
18 #[error(
20 "Invalid key: Only hexadecimal characters are allowed [1234567890abcdefABCDEF]"
21 )]
22 InvalidKeyCharset,
23
24 #[error("Invalid key: Length should be {0}")]
26 InvalidKeyLength(usize),
27}