Skip to main content

eggress_runtime/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum RuntimeError {
3    #[error("configuration error: {0}")]
4    Config(String),
5    #[error("listener bind error on {addr}: {source}")]
6    ListenerBind {
7        addr: String,
8        source: std::io::Error,
9    },
10    #[error("admin bind error on {addr}: {source}")]
11    AdminBind {
12        addr: String,
13        source: std::io::Error,
14    },
15    #[error("failed to initialize tokio runtime: {0}")]
16    RuntimeInit(#[from] std::io::Error),
17    #[error("runtime error: {0}")]
18    Other(String),
19}
20
21impl From<eggress_config::ConfigError> for RuntimeError {
22    fn from(e: eggress_config::ConfigError) -> Self {
23        RuntimeError::Config(e.to_string())
24    }
25}