platform/error/
network_error.rs1use thiserror::Error;
6
7#[derive(Error, Debug)]
9pub enum NetworkError {
10 #[error("Connection failed: {address}")]
11 ConnectionFailed { address: String },
12
13 #[error("Connection timeout: {address}")]
14 Timeout { address: String },
15
16 #[error("DNS resolution failed: {hostname}")]
17 DnsResolution { hostname: String },
18
19 #[error("Invalid address format: {address}")]
20 InvalidAddress { address: String },
21
22 #[error("Port binding failed: {port}")]
23 PortBindFailed { port: u16 },
24
25 #[error("TLS error: {message}")]
26 Tls { message: String },
27
28 #[error("WebSocket error: {0}")]
29 WebSocket(#[from] tokio_tungstenite::tungstenite::Error),
30
31 #[error("HTTP error: {status}")]
32 Http { status: u16 },
33}