simple_someip/protocol/sd/
error.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum Error {
6 #[error("Invalid value for Service Discovery entry type: {0:X}")]
8 InvalidEntryType(u8),
9 #[error("Invalid value for Service Discovery Option Type: {0:X}")]
11 InvalidOptionType(u8),
12 #[error("Invalid value for Service Discovery Option Transport Protocol: {0:X}")]
14 InvalidOptionTransportProtocol(u8),
15 #[error("Incorrect options size, {0} bytes remaining")]
17 IncorrectOptionsSize(usize),
18 #[error(
20 "Invalid SD option length for type 0x{option_type:02X}: expected {expected}, got {actual}"
21 )]
22 InvalidOptionLength {
23 option_type: u8,
25 expected: u16,
27 actual: u16,
29 },
30 #[error("Configuration string too long: {0} bytes")]
32 ConfigurationStringTooLong(usize),
33 #[error("Invalid SD message: {0}")]
35 InvalidMessage(&'static str),
36 #[error("Entries array length {0} is not a multiple of entry size (16)")]
38 IncorrectEntriesSize(usize),
39}