Skip to main content

wireguard_hyper_connector/
error.rs

1//! Error types for wireguard-hyper-connector.
2
3/// Result type alias for connector operations.
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Errors that can occur in the WireGuard hyper connector.
7#[derive(Debug, thiserror::Error)]
8pub enum Error {
9    #[error("URI has no host: {0}")]
10    NoHost(String),
11
12    #[error("Invalid server name: {0}")]
13    InvalidServerName(String),
14
15    #[error("TLS handshake failed: {0}")]
16    TlsHandshake(String),
17
18    #[error("DNS resolution failed: {0}")]
19    DnsResolution(#[from] wireguard_netstack::Error),
20
21    #[error("TCP connection failed: {0}")]
22    TcpConnect(String),
23
24    #[error("IO error: {0}")]
25    Io(#[from] std::io::Error),
26}