warp_reverse_proxy/errors.rs
1use thiserror::Error;
2use warp::reject::Reject;
3
4/// Lib errors wrapper
5/// Encapsulates the different errors that can occur during forwarding requests
6#[derive(Error, Debug)]
7pub enum Error {
8 /// Errors produced by reading or building requests
9 #[error("Request error: {0}")]
10 Request(#[from] reqwest::Error),
11
12 /// Errors when connecting to the target service
13 #[error("Http error: {0}")]
14 Http(#[from] warp::http::Error),
15}
16
17impl Reject for Error {}