trezor_client/transport/
error.rs1#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error(transparent)]
8 Usb(#[from] rusb::Error),
9
10 #[error(transparent)]
12 IO(#[from] std::io::Error),
13
14 #[error("the device to connect to was not found")]
16 DeviceNotFound,
17
18 #[error("the device is no longer available")]
20 DeviceDisconnected,
21
22 #[error("the device produced a data chunk of unexpected size")]
24 UnexpectedChunkSizeFromDevice(usize),
25
26 #[error("timeout expired while reading from device")]
28 DeviceReadTimeout,
29
30 #[error("the device sent a chunk with a wrong magic value")]
32 DeviceBadMagic,
33
34 #[error("the device sent a message with a wrong session id")]
36 DeviceBadSessionId,
37
38 #[error("the device sent an unexpected sequence number")]
40 DeviceUnexpectedSequenceNumber,
41
42 #[error("received a non-existing message type from the device")]
44 InvalidMessageType(u32),
45
46 #[error("unable to determine device serial number")]
48 NoDeviceSerial,
49}