Skip to main content

bunny_api_tokio/
error.rs

1//! Error types for this crate.
2
3/// Error type for this crate
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6    /// Reqwest error
7    #[error(transparent)]
8    Reqwest(#[from] reqwest::Error),
9
10    /// Header contains non-ASCII characters
11    #[error(transparent)]
12    InvalidHeader(#[from] reqwest::header::InvalidHeaderValue),
13
14    /// URL Parse error
15    #[error(transparent)]
16    ParseError(#[from] url::ParseError),
17
18    /// Authentication error
19    #[error("authentication error: {0}")]
20    Authentication(String),
21
22    /// Bad request error
23    #[error("bad request: {0}")]
24    BadRequest(String),
25
26    /// Not found error
27    #[error("not found: {0}")]
28    NotFound(String),
29
30    /// Internal server error
31    #[error("internal server error: {0}")]
32    InternalServerError(String),
33}