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
41
42
43
44
45
46
47
48
49
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
ParsecClientError(#[from] parsec_client::error::Error),
#[error(transparent)]
ParsecInterfaceError(#[from] parsec_client::core::interface::requests::ResponseStatus),
#[error(transparent)]
ParsecToolError(#[from] ToolErrorKind),
#[error(transparent)]
Base64Decode(#[from] base64::DecodeError),
}
#[derive(Error, Debug)]
pub enum ToolErrorKind {
#[error("Operation not supported by the parsec-tool")]
NotSupported,
#[error("They key was not created with the correct algorithm for this operation")]
WrongKeyAlgorithm,
#[error("A command expected input data that was not given")]
NoInput,
}
pub type Result<T> = std::result::Result<T, Error>;