1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum Error {
8 #[error("invalid URL: {0}")]
10 InvalidUrl(String),
11
12 #[error("URL parse error: {0}")]
14 UrlParse(#[from] url::ParseError),
15
16 #[cfg(feature = "http")]
18 #[error("HTTP request failed: {0}")]
19 Http(#[from] reqwest::Error),
20
21 #[error("failed to read file: {0}")]
23 Io(#[from] std::io::Error),
24
25 #[error("failed to parse HTML")]
27 ParseError,
28
29 #[error("invalid content type: expected HTML, got {0}")]
31 InvalidContentType(String),
32
33 #[cfg(feature = "http")]
35 #[error("SSRF protection: {0}")]
36 SsrfBlocked(String),
37}
38
39pub type Result<T> = std::result::Result<T, Error>;