#[non_exhaustive]pub enum CrawlError {
Retry(Error),
Session(Error),
ForceRetry(Error),
NonRetryable(Error),
Critical(Error),
MissingRoute {
label: Option<String>,
method: Method,
},
AntiBotDetected {
tech: AntiBotTech,
source: Error,
},
}Expand description
An error produced while processing a crawl request.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Retry(Error)
A retryable error that counts against the request retry limit.
Session(Error)
A retryable error that rotates the current session.
ForceRetry(Error)
A retryable error that ignores the request retry limit.
NonRetryable(Error)
A permanent request error that invokes the failure handler.
Critical(Error)
A critical error that aborts the crawler.
MissingRoute
No registered route matched a request’s label and method.
AntiBotDetected
A known anti-bot or web application firewall response was detected.
Fields
tech: AntiBotTechThe detected anti-bot technology.
Implementations§
Source§impl CrawlError
impl CrawlError
Sourcepub fn http_status(&self) -> Option<StatusCode>
pub fn http_status(&self) -> Option<StatusCode>
Returns an HTTP status carried anywhere in the underlying error chain.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Returns a Retry-After duration carried anywhere in the underlying error chain.
Sourcepub fn retry<E: Into<Error>>(error: E) -> Self
pub fn retry<E: Into<Error>>(error: E) -> Self
Creates a retryable error that counts against the retry limit.
Sourcepub fn session<E: Into<Error>>(error: E) -> Self
pub fn session<E: Into<Error>>(error: E) -> Self
Creates a retryable error that rotates the current session.
Sourcepub fn force_retry<E: Into<Error>>(error: E) -> Self
pub fn force_retry<E: Into<Error>>(error: E) -> Self
Creates a retryable error that ignores the retry limit.
Sourcepub fn non_retryable<E: Into<Error>>(error: E) -> Self
pub fn non_retryable<E: Into<Error>>(error: E) -> Self
Creates a permanent, non-retryable request error.
Sourcepub fn critical<E: Into<Error>>(error: E) -> Self
pub fn critical<E: Into<Error>>(error: E) -> Self
Creates a critical error that aborts the crawler.
Sourcepub fn fatal<E: Into<Error>>(error: E) -> Self
pub fn fatal<E: Into<Error>>(error: E) -> Self
Creates a permanent error that is never retried and runs the failure handler.
This is an alias for Self::non_retryable.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns whether the request should be attempted again.
Sourcepub fn rotates_session(&self) -> bool
pub fn rotates_session(&self) -> bool
Returns whether retrying should rotate the current session.
Sourcepub fn ignores_max_retries(&self) -> bool
pub fn ignores_max_retries(&self) -> bool
Returns whether the error ignores the request retry limit.
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Returns whether the error should abort the entire crawler.
Sourcepub fn counts_against_retries(&self) -> bool
pub fn counts_against_retries(&self) -> bool
Returns whether retrying counts against the request retry limit.
Trait Implementations§
Source§impl Debug for CrawlError
impl Debug for CrawlError
Source§impl Display for CrawlError
impl Display for CrawlError
Source§impl Error for CrawlError
impl Error for CrawlError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()