simple_someip/protocol/
error.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum Error {
5 #[error(transparent)]
6 Io(#[from] std::io::Error),
7 #[error("Invalid protocol version: {0:X}")]
8 InvalidProtocolVersion(u8),
9 #[error("Invalid value in MessageType field: {0:X}")]
10 InvalidMessageTypeField(u8),
11 #[error("Invalid value in ReturnCode field: {0:X}")]
12 InvalidReturnCode(u8),
13 #[error("Unsupported MessageID {0:X?}")]
14 UnsupportedMessageID(super::MessageId),
15 #[error("Invalid value for Service Discovery entry type: {0:X}")]
16 InvalidSDEntryType(u8),
17 #[error("Invalid value for Service Discovery Option Type: {0:X}")]
18 InvalidSDOptionType(u8),
19 #[error("Invalid value for Service Discovery Option Transport Protocol: {0:X}")]
20 InvalidSDOptionTransportProtocol(u8),
21 #[error("Incorrect options size, {0} bytes remaining")]
22 IncorrectOptionsSize(usize),
23 #[error("Too many SD entries for fixed-capacity buffer")]
24 TooManyEntries,
25 #[error("Too many SD options for fixed-capacity buffer")]
26 TooManyOptions,
27 #[error("Multicast socket not connected")]
28 MulticastSocketNotConnected,
29 #[error("Unicast socket not connected")]
30 UnicastSocketNotConnected,
31 #[error("Timeout expired")]
32 Timeout,
33 #[error("Invalid value for user type: {0}, {1}")]
34 InvalidValueUserType(String, u8),
35}