fix socks5 checking panic

Fixes #661
This commit is contained in:
monosans
2025-06-24 08:41:59 +03:00
parent 824b5e0f7a
commit 60e6ed2c89
4 changed files with 17 additions and 6 deletions
+13 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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(())