ソースを参照

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

epiphany 1 年間 前
コミット
f2850953d9
1 ファイル変更7 行追加1 行削除
  1. 7 1
      bin/fud/fud/src/tasks.rs

+ 7 - 1
bin/fud/fud/src/tasks.rs

@@ -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(),
+                        });
                     }
                 }
             },