1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum AnyTlsError {
6 #[error("IO error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("TLS error: {0}")]
12 Tls(String),
13
14 #[error("Protocol error: {0}")]
16 Protocol(String),
17
18 #[error("Authentication failed")]
20 AuthenticationFailed,
21
22 #[error("Stream not found: {0}")]
24 StreamNotFound(u32),
25
26 #[error("Session closed")]
28 SessionClosed,
29
30 #[error("Invalid frame: {0}")]
32 InvalidFrame(String),
33
34 #[error("Padding scheme error: {0}")]
36 PaddingScheme(String),
37
38 #[error("Configuration error: {0}")]
40 Config(String),
41}
42
43pub type Result<T> = std::result::Result<T, AnyTlsError>;