#[non_exhaustive]pub enum SitemapError {
XmlWriteError(Error),
XmlParseError(Error),
DateError(DateTimeError),
UrlError(ParseError),
IoError(Error),
EncodingError(FromUtf8Error),
InvalidChangeFreq(String),
CustomError(String),
SitemapTooLarge,
MaxUrlLimitExceeded(usize),
}Expand description
Errors that can occur when working with sitemaps.
This enum represents all possible errors that can occur within the sitemap library.
It uses the thiserror crate for deriving the Error trait, which simplifies
error handling and provides good interoperability with the standard library.
The non_exhaustive attribute allows for future expansion of the error types
without breaking backwards compatibility.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
XmlWriteError(Error)
Error occurred during XML writing.
XmlParseError(Error)
Error occurred during XML parsing.
DateError(DateTimeError)
Error occurred during date parsing or formatting.
UrlError(ParseError)
Error occurred during URL parsing.
IoError(Error)
Error occurred during I/O operations.
EncodingError(FromUtf8Error)
Error occurred during string encoding.
InvalidChangeFreq(String)
Invalid change frequency provided.
CustomError(String)
Custom error for unforeseen scenarios.
SitemapTooLarge
Error occurred when a sitemap exceeds the maximum allowed size.
MaxUrlLimitExceeded(usize)
Error occurred when the number of URLs in a sitemap exceeds the maximum allowed.
Implementations§
Source§impl SitemapError
impl SitemapError
Sourcepub fn context(&self) -> &'static str
pub fn context(&self) -> &'static str
Provides additional context for the error.
This method returns a static string that gives more information about the context in which the error occurred. This can be useful for logging or providing more detailed error messages to users.
§Returns
A string slice describing the context of the error.