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: need {needed} bytes, have {available}")]
18 IncorrectOptionsSize {
19 needed: usize,
21 available: usize,
23 },
24 #[error(
26 "Invalid SD option length for type 0x{option_type:02X}: expected {expected}, got {actual}"
27 )]
28 InvalidOptionLength {
29 option_type: u8,
31 expected: u16,
33 actual: u16,
35 },
36 #[error("Configuration string too long: {0} bytes")]
38 ConfigurationStringTooLong(usize),
39 #[error("Invalid SD message: {0}")]
41 InvalidMessage(&'static str),
42 #[error("Entries array length {0} is not a multiple of entry size (16)")]
44 IncorrectEntriesSize(usize),
45}