From 155fbaa31baf985bded1d9d699a046f238a65cca Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Mon, 1 Apr 2024 20:23:25 +0530 Subject: [PATCH] fix: forward error messages triggering retry (#333) This is for observability --- uplink/src/collector/downloader.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/uplink/src/collector/downloader.rs b/uplink/src/collector/downloader.rs index a3a1442c..c9fba679 100644 --- a/uplink/src/collector/downloader.rs +++ b/uplink/src/collector/downloader.rs @@ -185,7 +185,13 @@ impl FileDownloader { loop { match self.download(req, &mut download).await { Ok(_) => break, - Err(Error::Reqwest(e)) if !e.is_status() => error!("Download failed: {e}"), + Err(Error::Reqwest(e)) if !e.is_status() => { + let status = ActionResponse::progress(&self.action_id, "Download Failed", 0) + .set_sequence(self.sequence()) + .add_error(e.to_string()); + self.bridge_tx.send_action_response(status).await; + error!("Download failed: {e}"); + } Err(e) => return Err(e), } tokio::time::sleep(Duration::from_secs(1)).await;