netlink_packet_route/address/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: MIT

use netlink_packet_utils::nla::NlaError;
use netlink_packet_utils::DecodeError;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum AddressError {
    #[error("Invalid {kind}, got unexpected length of payload: {payload_length}")]
    ParseAttributeInvalidPayload { kind: &'static str, payload_length: usize },

    #[error("Invalid {kind} value")]
    ParseAttribute { kind: &'static str, err: DecodeError },

    #[error("unknown NLA {kind}")]
    ParseUnknownNLA { kind: u16, err: DecodeError },

    #[error(transparent)]
    NlaAttribute(#[from] NlaError),

    #[error("Faield to parse address buffer: {0:?}")]
    FailedBufferInit(DecodeError),
}