nam_ledger_proto/
error.rs1#[derive(Debug, displaydoc::Display)]
5#[cfg_attr(feature = "std", derive(thiserror::Error))]
6pub enum ApduError {
7 InvalidLength,
9
10 InvalidUtf8,
12
13 InvalidVersion(u8),
15
16 InvalidEncoding,
18
19 InvalidVariant,
21}
22
23impl From<encdec::Error> for ApduError {
24 fn from(value: encdec::Error) -> Self {
25 match value {
26 encdec::Error::Length => Self::InvalidLength,
27 encdec::Error::Utf8 => Self::InvalidUtf8,
28 encdec::Error::Variant => Self::InvalidVariant,
29 }
30 }
31}