use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("invalid URL: {0}")]
InvalidUrl(String),
#[error("URL parse error: {0}")]
UrlParse(#[from] url::ParseError),
#[cfg(feature = "http")]
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("failed to read file: {0}")]
Io(#[from] std::io::Error),
#[error("failed to parse HTML")]
ParseError,
#[error("invalid content type: expected HTML, got {0}")]
InvalidContentType(String),
#[cfg(feature = "http")]
#[error("SSRF protection: {0}")]
SsrfBlocked(String),
}
pub type Result<T> = std::result::Result<T, Error>;