Skip to main content

mechanics_http_server/
error.rs

1//! Error types for the HTTP/3 server surface.
2
3/// Crate-local result alias.
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Errors returned by `mechanics-http-server`.
7#[non_exhaustive]
8#[derive(Debug, thiserror::Error)]
9pub enum Error {
10    /// The caller supplied TLS material rustls could not use.
11    #[error("invalid TLS material: {0}")]
12    InvalidTls(String),
13    /// The QUIC endpoint could not bind its UDP socket.
14    #[error("QUIC endpoint bind failed: {0}")]
15    BindFailed(String),
16    /// An internal QUIC, HTTP/3, tower, or task error occurred.
17    #[error("internal: {0}")]
18    Internal(String),
19}