diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-10-14 14:22:49 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-10-14 14:22:49 +0200 |
commit | 29b2705a344467c92dfa3f2ea65ab536c96fe74e (patch) | |
tree | a5aca4eda2d03a91bc77f21b4c3415da135b312f | |
parent | 1cfaf49932d4c13cfaec29baef31b010abb70f4c (diff) |
make error enum style consistent with my convention
-rw-r--r-- | src/error.rs | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/error.rs b/src/error.rs index 0d133d6..4f5248c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,40 +7,42 @@ use thiserror::Error; #[derive(Debug, Error)] pub enum Error { - #[error("no ipv4 addr on interface {0}")] - NoIpv4Addr(String), - #[error("unhandled or unknown opcode {0:?}")] - InvalidOpcode(Opcode), - #[error("missing message type")] - NoMsgType, - #[error("unhandled or unknown message type {0:?}")] - InvalidMsgType(MessageType), - #[error("missing client id")] - NoClientId, #[error("empty client id")] EmptyClientId, + #[error("unhandled or unknown message type {0:?}")] + InvalidMsgType(MessageType), + #[error("unhandled or unknown opcode {0:?}")] + InvalidOpcode(Opcode), #[error("missing ip address in dhcprequest")] NoAddrRequested, - #[error("addr pool exhausted")] - PoolExhausted, + #[error("missing client id")] + NoClientId, + #[error("no ipv4 addr on interface {0}")] + NoIpv4Addr(String), + #[error("missing message type")] + NoMsgType, #[error("bytes sent not equal to pkt size")] PartialResponse, - #[error("dhcproto encode error")] - DhcprotoEncode(#[from] dhcproto::error::EncodeError), - #[error("dhcproto decode error")] - DhcprotoDecode(#[from] dhcproto::error::DecodeError), + #[error("addr pool exhausted")] + PoolExhausted, + + #[error("ip addr parse error")] + AddrParseError(#[from] net::AddrParseError), + #[error("ffi nul error (string contains nul bytes)")] + FfiNulError(#[from] ffi::NulError), #[error("io error")] Io(#[from] io::Error), + + #[error("dhcproto decode error")] + DhcprotoDecode(#[from] dhcproto::error::DecodeError), + #[error("dhcproto encode error")] + DhcprotoEncode(#[from] dhcproto::error::EncodeError), #[error("linkaddrs error")] LinkAddrs(#[from] linkaddrs::Error), #[error("rsdsl_netlinkd error")] RsdslNetlinkd(#[from] rsdsl_netlinkd::error::Error), #[error("serde_json error")] SerdeJson(#[from] serde_json::Error), - #[error("ip addr parse error")] - AddrParseError(#[from] net::AddrParseError), - #[error("ffi nul error (string contains nul bytes)")] - FfiNulError(#[from] ffi::NulError), } pub type Result<T> = std::result::Result<T, Error>; |