1#[cfg(doc)]
4use crate::{NetHsm, connection};
5
6#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("TLS error: {0}")]
11 Rustls(#[from] rustls::Error),
12
13 #[error("Decoding Base64 string failed: {0}")]
15 Base64Decode(#[from] base64ct::Error),
16
17 #[error("NetHSM error: {0}")]
19 Default(String),
20
21 #[error("Loading system TLS certs failed: {0:?}")]
23 CertLoading(Vec<rustls_native_certs::Error>),
24
25 #[error("Unable to load any system TLS certs ({failed} failed)")]
29 NoSystemCertsAdded {
30 failed: usize,
32 },
33
34 #[error("NetHSM API error: {0}")]
36 Api(String),
37
38 #[error("NetHSM connection error:\n{0}")]
40 Connection(#[from] crate::connection::Error),
41
42 #[error("Key error: {0}")]
44 Key(#[from] crate::key::Error),
45
46 #[error("User data error: {0}")]
48 User(#[from] crate::user::Error),
49
50 #[error("OpenPGP error: {0}")]
52 OpenPgp(#[from] crate::openpgp::Error),
53
54 #[error("A signstar_crypto key error:\n{0}")]
56 SignstarCryptoKey(#[from] signstar_crypto::key::Error),
57}