rule34/
error.rs

1/// The Error that occurs when a `HtmlPost` could not be parsed.
2#[cfg(feature = "scrape")]
3pub type HtmlPostError = crate::types::html_post::FromHtmlError;
4
5/// Crate Error Type
6#[derive(Debug, thiserror::Error)]
7#[non_exhaustive]
8pub enum Error {
9    /// Reqwest HTTP Error
10    #[error("reqwest http error")]
11    Reqwest(#[from] reqwest::Error),
12
13    /// Invalid URL Error
14    #[error(transparent)]
15    InvalidUrl(#[from] url::ParseError),
16
17    /// Invalid json
18    #[error(transparent)]
19    InvalidJson(#[from] serde_json::Error),
20
21    /// Invalid Post
22    #[error("invalid html post")]
23    #[cfg(feature = "scrape")]
24    InvalidHtmlPost(#[from] HtmlPostError),
25
26    /// A tokio task failed to join
27    #[error("failed to join tokio task")]
28    TokioJoin(#[from] tokio::task::JoinError),
29
30    /// XML deserialization error
31    #[error("xml deserialize error")]
32    XmlDeserialize(#[from] quick_xml::DeError),
33
34    /// The limit was too large
35    #[error("the limit {0} is too large")]
36    LimitTooLarge(u16),
37
38    /// Missing auth
39    #[error("missing authentication")]
40    MissingAuth,
41}