Skip to main content

krot_server/
error.rs

1//! Unified server error type.
2
3use thiserror::Error;
4
5use krot_transport::TransportError;
6
7#[derive(Debug, Error)]
8pub enum ServerError {
9    #[error("io: {0}")]
10    Io(#[from] std::io::Error),
11
12    #[error("transport: {0}")]
13    Transport(#[from] TransportError),
14
15    #[error("rustls: {0}")]
16    Rustls(#[from] rustls::Error),
17
18    #[error("rcgen: {0}")]
19    Rcgen(#[from] rcgen::Error),
20
21    #[error("authorized_keys: {0}")]
22    Keys(String),
23
24    #[error("admin token: {0}")]
25    AdminToken(&'static str),
26
27    #[error("protocol violation: {0}")]
28    Protocol(&'static str),
29
30    #[error("port pool exhausted")]
31    PortPoolExhausted,
32}