Skip to main content

hush_proxy/
error.rs

1//! Error types for hush-proxy
2
3use thiserror::Error;
4
5/// Errors that can occur during proxy operations
6#[non_exhaustive]
7#[derive(Error, Debug)]
8pub enum Error {
9    #[error("DNS parsing error: {0}")]
10    DnsParseError(String),
11
12    #[error("SNI parsing error: {0}")]
13    SniParseError(String),
14
15    #[error("Policy violation: {0}")]
16    PolicyViolation(String),
17
18    #[error("IO error: {0}")]
19    IoError(#[from] std::io::Error),
20}
21
22/// Result type for hush-proxy operations
23pub type Result<T> = std::result::Result<T, Error>;