favicon_picker/
error.rs

1use reqwest::StatusCode;
2use scraper::error;
3
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("{0}")]
7    SelectorKind(#[from] error::SelectorErrorKind<'static>),
8    #[error("{0}")]
9    UrlParse(#[from] url::ParseError),
10    #[error("the `href` attribute is not found in element_ref")]
11    HrefNotFound,
12    #[error(transparent)]
13    Reqwest(#[from] reqwest::Error),
14    #[error("No elements was been found with the selector `link[rel='icon']`")]
15    NoLinkIconElements,
16    #[error("We got a {code} while fetching for the icons bytes")]
17    ReqwestSend {
18        code: StatusCode
19    }
20}