rsiot/components_config/modbus_frame/
error.rs1#[allow(missing_docs)]
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4 #[error("Wrong address in packet: {address_in_packet}; expected: {expected_address}")]
5 AddressMismatch {
6 address_in_packet: u8,
7 expected_address: u8,
8 },
9
10 #[error("CRC mismatch")]
11 CRCMismatch,
12
13 #[error("Length mismatch in packet: {length_in_packet}; expected: {expected_length}")]
14 LengthMismatch {
15 length_in_packet: usize,
16 expected_length: usize,
17 },
18
19 #[error("Frame too short. Length: {length}")]
20 FrameTooShort { length: usize },
21
22 #[error("TryGetError: {0}")]
23 TryGetError(#[from] bytes::TryGetError),
24}