netlink_proto/
errors.rs

1// SPDX-License-Identifier: MIT
2
3use std::io;
4
5use netlink_packet_core::NetlinkMessage;
6
7#[derive(thiserror::Error, Debug)]
8pub enum Error<T> {
9    /// The netlink connection is closed
10    #[error("the netlink connection is closed")]
11    ConnectionClosed,
12
13    /// Received an error message as a response
14    #[error("received an error message as a response: {0:?}")]
15    NetlinkError(NetlinkMessage<T>),
16
17    /// Error while reading from or writing to the netlink socket
18    #[error("error while reading from or writing to the netlink socket: {0}")]
19    SocketIo(#[from] io::Error),
20}