2026-03-29 16:40:10 +02:00
|
|
|
/// Fetch-layer errors. Wraps HTTP/network failures into a single type
|
2026-03-23 18:31:11 +01:00
|
|
|
/// that callers can match on without leaking transport details.
|
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Error)]
|
|
|
|
|
pub enum FetchError {
|
|
|
|
|
#[error("request failed: {0}")]
|
2026-03-29 16:40:10 +02:00
|
|
|
Request(#[from] webclaw_http::Error),
|
2026-03-23 18:31:11 +01:00
|
|
|
|
|
|
|
|
#[error("invalid url: {0}")]
|
|
|
|
|
InvalidUrl(String),
|
|
|
|
|
|
|
|
|
|
#[error("response body decode failed: {0}")]
|
|
|
|
|
BodyDecode(String),
|
|
|
|
|
|
|
|
|
|
#[error("extraction failed: {0}")]
|
|
|
|
|
Extraction(#[from] webclaw_core::ExtractError),
|
|
|
|
|
|
|
|
|
|
#[error("PDF extraction failed: {0}")]
|
|
|
|
|
Pdf(#[from] webclaw_pdf::PdfError),
|
|
|
|
|
|
|
|
|
|
#[error("client build failed: {0}")]
|
|
|
|
|
Build(String),
|
|
|
|
|
}
|