Skip to main content

simple_someip/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum Error {
5    #[error(transparent)]
6    ProtocolError(#[from] crate::protocol::Error),
7    #[error(transparent)]
8    Io(#[from] std::io::Error),
9    #[error("Unexpected discovery message: {0:?}")]
10    UnexpectedDiscoveryMessage(crate::protocol::Header),
11    #[error("Socket Closed Unexpectedly")]
12    SocketClosedUnexpectedly,
13    #[error("Unicast Socket not bound")]
14    UnicastSocketNotBound,
15    #[error("output buffer too small: need {needed} bytes, got {actual}")]
16    BufferTooSmall { needed: usize, actual: usize },
17}