From b00ad5dc52d8702ce3fbc9d260f0fc5578bf9559 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 4 Nov 2026 14:56:22 +0100 Subject: [PATCH] better error logging when trigger request fails --- src/main.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8897564..6e7d9d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,6 +117,17 @@ fn trigger(client: &Agent, feed: &FeedConfig, config: &Config) -> Result<(), Tri } else { req.send_empty()?; }; + + let status = res.status(); + if !status.is_success() { + let body = res.into_body().read_to_string()?; + error!( + status = %status, + response = body, + "error response while triggering hook" + ); + } + Ok(()) } @@ -130,7 +141,11 @@ pub struct FeedFetcher { impl FeedFetcher { pub fn new(interval: Duration) -> Self { FeedFetcher { - client: Agent::new_with_defaults(), + client: Agent::new_with_config( + ureq::config::Config::builder() + .http_status_as_error(false) + .build(), + ), base_interval: interval, cache: HashMap::default(), fetch_plans: HashMap::default(),