Skip to main content

arks_server/
error.rs

1//! Server errors.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum ServerError {
7    #[error("{0}")]
8    Msg(String),
9    #[error("protocol: {0}")]
10    Protocol(String),
11    #[error("not implemented: {0}")]
12    NotImplemented(String),
13    #[error("io: {0}")]
14    Io(String),
15}
16
17impl From<std::io::Error> for ServerError {
18    fn from(e: std::io::Error) -> Self {
19        Self::Io(e.to_string())
20    }
21}