commit daff78d13c4be8c178eed2b34ca07cfb16ea5a70 from: witcher date: Mon Feb 20 12:48:43 2023 UTC fix: Show URL of failed request Implements: https://todo.sr.ht/~witcher/rss-email/27 Implements: https://todo.sr.ht/~witcher/rss-email/26 commit - c78d7af3acd6f2ab3cb7c4fb8a8ddf39a5216e4a commit + daff78d13c4be8c178eed2b34ca07cfb16ea5a70 blob - 66138f66e52c9c8c9b8e92701e1eabb768489ecd blob + 9756a552b44ec012afbaf5965457adc1acde6a5b --- src/feed.rs +++ src/feed.rs @@ -17,7 +17,7 @@ where let url = url.as_ref(); let content = reqwest::get(url).await?.bytes().await?; match fetch_new_rss(&content[..]) { - Err(_) => fetch_new_atom(&content[..]), + Err(_) => fetch_new_atom(&content[..]).context(format!("Failed fetching feed for {url}")), p => p, } } blob - ac60152648ef721ce4e6f3ba1a6413233672ee48 blob + 65ac5fd04dccdb411f0775c7185f365bd0c0d071 --- src/main.rs +++ src/main.rs @@ -118,7 +118,13 @@ async fn fetch_feeds(urls: Vec, pool: &sqlx::P } while let Some(new) = set.join_next().await { - let posts = new??; + let posts = match new? { + Ok(p) => p, + Err(e) => { + log::error!("Error while fetching feed: {}", e); + continue; + } + }; for i in posts { let conn = pool.acquire().await?;