use thiserror::Error;
#[derive(Error, Debug)]
pub enum DoIpError {
#[error("Payload length in header does match expected payload type length: {value:?}, expected: {expected:?}")]
PayloadLengthTooShort {
value: u32,
expected: u32,
},
#[error("Unknown activation type value: {0}")]
UnknownActivationType(u8),
#[error("Unknown routing activation response code value: {0}")]
UnknownRoutingActivationResponseCode(u8),
#[error("Unexpected payload type found: {value:?}")]
UnexpectedPayloadType {
value: u16,
},
#[error("Buffer to small")]
BufferTooSmall,
#[error(transparent)]
Io(#[from] std::io::Error),
}