Skip to main content

Module error

Module error 

Source
Expand description

Shared error types for the workspace.

The runtime keeps transport, parsing, configuration, and pipeline failures in a small set of error enums so applications can match on them consistently.

§Example

use spider_util::error::{SpiderError, PipelineError};
use url::Url;

// URL parsing error
let result: Result<Url, SpiderError> = Url::parse("not-a-url").map_err(SpiderError::from);
if let Err(e) = result {
    println!("Error: {}", e);
}

// Pipeline error
let pipeline_err = PipelineError::IoError("File not found".to_string());

Structs§

ReqwestError
Simplified wrapper around reqwest::Error.

Enums§

PipelineError
Error type used by item pipelines.
SpiderError
Main runtime error type used across the crawler stack.