1use card_backend::SmartcardError;
13
14use crate::ocard::StatusBytes;
15
16#[derive(thiserror::Error, Debug)]
18#[non_exhaustive]
19pub enum Error {
20 #[error("Error interacting with smartcard: {0}")]
21 Smartcard(#[from] SmartcardError),
22
23 #[error("OpenPGP card error status: {0}")]
24 CardStatus(#[from] StatusBytes),
25
26 #[error("Command too long ({0} bytes)")]
27 CommandTooLong(usize),
28
29 #[error("Unexpected response length: {0}")]
30 ResponseLength(usize),
31
32 #[error("Data not found: {0}")]
33 NotFound(String),
34
35 #[error("Couldn't parse data: {0}")]
36 ParseError(String),
37
38 #[error("Unsupported algorithm: {0}")]
39 UnsupportedAlgo(String),
40
41 #[error("Unsupported feature: {0}")]
42 UnsupportedFeature(String),
43
44 #[error("Internal error: {0}")]
46 InternalError(String),
47}