pub enum SitemapError {
Xml(Error),
Decompression(String),
DecompressionBomb {
limit: usize,
},
PayloadTooLarge {
size: u64,
limit: u64,
},
Encoding(String),
InvalidUrl(ParseError),
Io(Error),
Network(Error),
HttpStatus(u16),
MaxDepthExceeded(u8),
CircularReference(String),
}Expand description
Errors produced by sitemap download, decompression, or (strict) expansion.
Streaming XML parse itself is fault-tolerant and does not surface as an
error: malformed documents yield a partial crate::ParsedSitemap instead.
Variants§
Xml(Error)
Underlying quick-xml tokenizer failure (reserved for strict parsers).
Decompression(String)
Gzip inflate failed (truncated stream, CRC mismatch, …).
DecompressionBomb
Inflated payload exceeded the configured uncompressed-size cap.
This is the primary defence against gzip/deflate bombs.
PayloadTooLarge
HTTP response body (or declared Content-Length) exceeded the download cap.
Encoding(String)
Byte stream could not be decoded as UTF-8 / UTF-16.
InvalidUrl(ParseError)
A URL failed to parse (kept for callers that validate locs strictly).
Io(Error)
Local I/O failure while reading decompressed bytes.
Network(Error)
HTTP transport error from reqwest.
HttpStatus(u16)
Non-success HTTP status from the sitemap origin.
MaxDepthExceeded(u8)
Recursive expansion exceeded the caller-supplied depth budget.
expand_all isolates this per-child (it skips instead of failing the
whole tree). Exposed so strict callers can treat it as fatal.
CircularReference(String)
A sitemap index loc pointed at an already-visited ancestor (cycle).
expand_all isolates this per-child. Exposed so strict callers can
treat it as fatal.
Trait Implementations§
Source§impl Debug for SitemapError
impl Debug for SitemapError
Source§impl Display for SitemapError
impl Display for SitemapError
Source§impl Error for SitemapError
impl Error for SitemapError
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()