fud/tasks: send event for any error that stopped the fetch task

This commit is contained in:
epiphany
2025-07-30 15:50:53 +02:00
parent 6e9e1f3084
commit f2850953d9

View File

@@ -65,7 +65,13 @@ pub async fn get_task(fud: Arc<Fud>, executor: ExecutorPtr) -> Result<()> {
match res {
Ok(()) | Err(Error::DetachedTaskStopped) => { /* Do nothing */ }
Err(e) => {
error!(target: "fud::get_task()", "Error while fetching resource: {e}")
error!(target: "fud::get_task()", "Error while fetching resource: {e}");
// Send a DownloadError for any error that stopped the fetch task
notify_event!(fud_2, DownloadError, {
hash,
error: e.to_string(),
});
}
}
},