From 0704475d28306fdb97eadf7de965ed7bc1fc4446 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Mon, 22 Dec 2025 22:25:46 -0500 Subject: [PATCH] switch generic route allocation error to tryagain --- veilid-core/examples/private_route/src/main.rs | 10 ---------- veilid-core/src/veilid_api/api.rs | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/veilid-core/examples/private_route/src/main.rs b/veilid-core/examples/private_route/src/main.rs index ba53566a..0b5c53c0 100644 --- a/veilid-core/examples/private_route/src/main.rs +++ b/veilid-core/examples/private_route/src/main.rs @@ -97,16 +97,6 @@ async fn try_again_loop>>( let _ = std::io::stdout().flush(); tools::sleep(1000).await; } - // XXX: This should not be necessary, and VeilidAPIError::TryAgain should - // be used in the case of 'allocated route failed to test'. - Err(VeilidAPIError::Generic { message }) => { - if waiting { - println!(); - waiting = false; - } - println!("Error: {message}"); - tools::sleep(1000).await; - } Err(e) => { if waiting { println!(); diff --git a/veilid-core/src/veilid_api/api.rs b/veilid-core/src/veilid_api/api.rs index dc64013f..4019c97b 100644 --- a/veilid-core/src/veilid_api/api.rs +++ b/veilid-core/src/veilid_api/api.rs @@ -369,11 +369,11 @@ impl VeilidAPI { } Some(false) => { rss.release_route(route_id.clone()); - apibail_generic!("allocated route failed to test"); + apibail_try_again!("allocated route failed to test"); } None => { rss.release_route(route_id.clone()); - apibail_generic!("allocated route could not be tested"); + apibail_try_again!("allocated route could not be tested"); } } let private_routes = rss.assemble_private_route_set(&route_id, Some(true))?;