ptth/crates/ptth_server/src/errors.rs

20 lines
569 B
Rust
Raw Normal View History

use thiserror::Error;
#[derive (Debug, Error)]
pub enum ServerError {
#[error ("File server error")]
FileServer (#[from] super::file_server::errors::FileServerError),
#[error ("Hyper HTTP error")]
Http (#[from] hyper::http::Error),
#[error ("Hyper invalid header name")]
InvalidHeaderName (#[from] hyper::header::InvalidHeaderName),
#[error ("Can't parse wrapped requests")]
CantParseWrappedRequests (rmp_serde::decode::Error),
2020-11-29 20:22:40 +00:00
#[error ("Can't convert Hyper request to PTTH request")]
CantConvertHyperToPtth (#[from] ptth_core::http_serde::Error),
}