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