better error logging when trigger request fails

This commit is contained in:
Robin Appelman 2026-11-04 14:56:22 +01:00
commit b00ad5dc52
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE

View file

@ -117,6 +117,17 @@ fn trigger(client: &Agent, feed: &FeedConfig, config: &Config) -> Result<(), Tri
} else { } else {
req.send_empty()?; 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(()) Ok(())
} }
@ -130,7 +141,11 @@ pub struct FeedFetcher {
impl FeedFetcher { impl FeedFetcher {
pub fn new(interval: Duration) -> Self { pub fn new(interval: Duration) -> Self {
FeedFetcher { FeedFetcher {
client: Agent::new_with_defaults(), client: Agent::new_with_config(
ureq::config::Config::builder()
.http_status_as_error(false)
.build(),
),
base_interval: interval, base_interval: interval,
cache: HashMap::default(), cache: HashMap::default(),
fetch_plans: HashMap::default(), fetch_plans: HashMap::default(),