Give more context on feed exceptions

This commit is contained in:
2025-04-26 11:52:00 +02:00
parent e2c0a9b4c2
commit 7dd2dedef7

View File

@@ -36,8 +36,16 @@ struct FeedItem {
} }
fn fetch_feed(url: impl IntoUrl) -> Result<Feed> { fn fetch_feed(url: impl IntoUrl) -> Result<Feed> {
let content = reqwest::blocking::get(url)?.bytes()?; let r = reqwest::blocking::get(url)
Ok(parse(&content[..])?) .context("Failed to fetch feed")?;
let content = r.bytes()
.context("Failed to read feed contents")?;
let feed = parse(&content[..])
.context("Failed to parse feed")?;
Ok(feed)
} }
struct FeedFile { struct FeedFile {