batman_robin/error.rs
1use thiserror::Error;
2
3/// Represents all possible errors returned by the Robin library.
4///
5/// This includes errors from netlink communication, I/O operations, parsing,
6/// and cases where requested items are not found.
7#[derive(Error, Debug)]
8pub enum Error {
9 /// Represents errors originating from netlink operations.
10 ///
11 /// Contains a `String` describing the underlying netlink error.
12 #[error("Netlink error: {0}")]
13 Netlink(String),
14
15 /// Represents I/O related errors.
16 ///
17 /// Contains a `String` describing the underlying I/O failure.
18 #[error("I/O error: {0}")]
19 Io(String),
20
21 /// Represents errors encountered during parsing of netlink messages or other data.
22 ///
23 /// Contains a `String` describing the parsing issue.
24 #[error("Argument error: {0}")]
25 Argument(String),
26
27 /// Indicates that a requested item was not found.
28 ///
29 /// Contains a `String` describing what could not be found.
30 #[error("Not found: {0}")]
31 NotFound(String),
32}