]> code.octet-stream.net Git - netwatcher/blob - src/error.rs
Improve errors
[netwatcher] / src / error.rs
1 /// Errors in netwatcher or in one of the underlying platform integratinos.
2 #[derive(Debug, Clone, PartialEq, Eq)]
3 #[non_exhaustive]
4 pub enum Error {
5 CreateSocket(String),
6 Bind(String),
7 CreatePipe(String),
8 Getifaddrs(String),
9 GetInterfaceName(String),
10 FormatMacAddress,
11 UnexpectedWindowsResult(u32),
12 AddressNotAssociated,
13 InvalidParameter,
14 NotEnoughMemory,
15 InvalidHandle,
16 }
17
18 impl std::fmt::Display for Error {
19 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 write!(f, "{:?}", self)
21 }
22 }
23
24 impl std::error::Error for Error {}