#[derive(Debug, thiserror::Error)]
pub enum FeedError {
#[error("feed entry `{path}` has an empty {field}; readers render it as a blank row")]
IncompleteEntry { path: String, field: &'static str },
#[error(
"feed entry path `{path}` is not rooted; use a site-relative path such as `/blog/a-post`"
)]
UnrootedPath { path: String },
#[error(
"feed entry `{path}` uses `srcset`, which is not rewritten; use a single `src` so the \
feed cannot ship half-absolute image URLs"
)]
SrcsetUnsupported { path: String },
#[error(
"the feed's page `{page_url}` is not a declared page; its `rel=\"alternate\"` would 404"
)]
PageNotDeclared { page_url: String },
#[error("feed entry `{path}` names image `{image}`, which is not in the asset manifest")]
UnresolvedImage { path: String, image: String },
#[error("failed to serialize the {format} feed")]
Write {
format: &'static str,
#[source]
source: std::io::Error,
},
#[error("the serialized {format} feed was not valid UTF-8")]
Encoding { format: &'static str },
#[error("failed to serialize the JSON feed")]
Json {
#[source]
source: serde_json::Error,
},
}