Expand description
Custom error types for the spider framework.
This module defines comprehensive error types used throughout the spider ecosystem:
SpiderError: The main error type for the spider framework, covering network failures, URL parsing problems, I/O errors, configuration issues, and pipeline errors.PipelineError: Specialized errors for item processing pipelines.ReqwestError: A simplified wrapper around reqwest errors with additional context about connection and timeout issues.
By centralizing error definitions, the module provides a consistent and semantic way to report and handle errors, improving the robustness and maintainability of web scraping applications.
§Example
use spider_util::error::{SpiderError, PipelineError};
use url::Url;
// URL parsing error
let result: Result<Url, SpiderError> = Url::parse("not-a-url");
if let Err(e) = result {
println!("Error: {}", e);
}
// Pipeline error
let pipeline_err = PipelineError::IoError("File not found".to_string());Structs§
- Reqwest
Error - A wrapper around reqwest errors with additional context.
Enums§
- Pipeline
Error - Error type for item processing pipelines.
- Spider
Error - The main error type for the spider framework.