use card_backend::SmartcardError;
use crate::ocard::StatusBytes;
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum Error {
#[error("Error interacting with smartcard: {0}")]
Smartcard(#[from] SmartcardError),
#[error("OpenPGP card error status: {0}")]
CardStatus(#[from] StatusBytes),
#[error("Command too long ({0} bytes)")]
CommandTooLong(usize),
#[error("Unexpected response length: {0}")]
ResponseLength(usize),
#[error("Data not found: {0}")]
NotFound(String),
#[error("Couldn't parse data: {0}")]
ParseError(String),
#[error("Unsupported algorithm: {0}")]
UnsupportedAlgo(String),
#[error("Unsupported feature: {0}")]
UnsupportedFeature(String),
#[error("Internal error: {0}")]
InternalError(String),
}