1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::fmt;
#[derive(Debug)]
pub enum EzNaclError {
DecodingError,
DecryptionError,
EncodingError,
EncryptionError,
KeyError,
SignatureError,
SizeError,
UnsupportedAlgorithm
}
impl std::error::Error for EzNaclError {}
impl fmt::Display for EzNaclError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
EzNaclError::DecodingError => write!(f, "Base85 Decoding Error"),
EzNaclError::DecryptionError => write!(f, "Decryption Error"),
EzNaclError::EncodingError => write!(f, "Encoding Error"),
EzNaclError::EncryptionError => write!(f, "Encryption Error"),
EzNaclError::KeyError => write!(f, "Key Error"),
EzNaclError::SignatureError => write!(f, "Signature Error"),
EzNaclError::SizeError => write!(f, "Size Error"),
EzNaclError::UnsupportedAlgorithm => write!(f, "Unsupported Algorithm"),
}
}
}