+13
-2
@@ -64,8 +64,19 @@ pub async fn check_all(
|
||||
}
|
||||
|
||||
while let Some(res) = join_set.join_next().await {
|
||||
res.wrap_err("failed to join proxy checking task")?
|
||||
.wrap_err("proxy checking worker failed")?;
|
||||
match res {
|
||||
Ok(Ok(())) => {}
|
||||
Ok(Err(e)) => {
|
||||
return Err(e).wrap_err("proxy checking task failed");
|
||||
}
|
||||
Err(e) => {
|
||||
if e.is_panic() {
|
||||
tracing::error!("proxy checking task panicked: {}", e);
|
||||
} else {
|
||||
tracing::error!("proxy checking task was cancelled: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Arc::into_inner(checked_proxies)
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ async fn main() -> color_eyre::Result<()> {
|
||||
drop(http_client);
|
||||
|
||||
while let Some(task) = output_dependencies_tasks.join_next().await {
|
||||
task.wrap_err("failed to join output dependencies task")??;
|
||||
task.wrap_err("output dependencies task panicked or was cancelled")??;
|
||||
}
|
||||
drop(output_dependencies_tasks);
|
||||
|
||||
|
||||
+2
-2
@@ -153,8 +153,8 @@ pub async fn scrape_all(
|
||||
}
|
||||
|
||||
while let Some(res) = join_set.join_next().await {
|
||||
res.wrap_err("failed to join proxy scrape task")?
|
||||
.wrap_err("proxy scrape task failed")?;
|
||||
res.wrap_err("proxy scraping task panicked or was cancelled")?
|
||||
.wrap_err("proxy scraping task failed")?;
|
||||
}
|
||||
|
||||
Ok(Arc::into_inner(proxies)
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ impl Tui {
|
||||
}
|
||||
drop(rx);
|
||||
while let Some(task) = join_set.join_next().await {
|
||||
task.wrap_err("failed to join event listener task")?
|
||||
task.wrap_err("event listener task panicked or was cancelled")?
|
||||
.wrap_err("event listener task failed")?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user