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
31
32
33
34
35
36
37
38
39
40
use bincode::ErrorKind;
use block_modes::BlockModeError;
use err_derive::Error;
use std::io::Error as IoError;
#[derive(Debug, Error)]
#[allow(missing_docs)]
pub enum SelfEncryptionError {
#[error(display = "An error during compression or decompression.")]
Compression,
#[error(display = "An error during initializing CBC-AES cipher instance.")]
Cipher(String),
#[error(display = "An error within the symmetric encryption process.")]
Encryption,
#[error(display = "An error within the symmetric decryption process.")]
Decryption(#[source] BlockModeError),
#[error(display = "A generic I/O error")]
Io(#[source] IoError),
#[error(display = "An error in putting or retrieving chunks from the storage object.")]
Storage,
#[error(display = "Generic error")]
Generic(String),
#[error(display = "Serialisation error")]
Bincode(#[source] Box<ErrorKind>),
#[error(display = "deserialization")]
Deserialise,
#[error(display = "num parse error")]
NumParse(#[source] std::num::ParseIntError),
#[error(display = "Rng error")]
Rng(#[source] rand::Error),
}