nym_wireguard/
error.rs

1// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: Apache-2.0
3
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("{0}")]
7    Defguard(#[from] defguard_wireguard_rs::error::WireguardInterfaceError),
8
9    #[error("internal {0}")]
10    Internal(String),
11
12    #[error("storage should have the requested bandwidth entry")]
13    MissingClientBandwidthEntry,
14
15    #[error("kernel should have the requested client entry: {0}")]
16    MissingClientKernelEntry(String),
17
18    #[error("{0}")]
19    GatewayStorage(#[from] nym_gateway_storage::error::GatewayStorageError),
20
21    #[error("{0}")]
22    SystemTime(#[from] std::time::SystemTimeError),
23
24    #[error("IP pool error: {0}")]
25    IpPool(String),
26}
27
28pub type Result<T> = std::result::Result<T, Error>;