From 2cdbb0f071b304c0473bb873ff3d6a26f0382ed3 Mon Sep 17 00:00:00 2001 From: Olivier De Jonckere Date: Fri, 30 Jan 2026 17:58:41 +0100 Subject: [PATCH] Handle errors now returned by A-SABR --- src/py_asabr_router.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/py_asabr_router.rs b/src/py_asabr_router.rs index ab93acb..2b8d149 100644 --- a/src/py_asabr_router.rs +++ b/src/py_asabr_router.rs @@ -40,7 +40,7 @@ impl PyAsabrRouter { match contact_plan { Ok((nodes, contacts)) => { let nodes_id_map = make_nodes_id_map(&nodes); - let router = build_generic_router::( + let Ok(router) = build_generic_router::( router_type, nodes, contacts, @@ -49,7 +49,9 @@ impl PyAsabrRouter { check_size: true, max_entries: 10, }), - ); + ) else { + panic!("build_generic_router failed."); + }; Ok(Self { nodes_id_map, @@ -72,7 +74,7 @@ impl PyAsabrRouter { ) -> Vec<(PyAsabrContact, Vec)> { let bundle = bundle.to_native_bundle(); - if let Some(routing_output) = self + if let Ok(Some(routing_output)) = self .router .route(source, &bundle, curr_time, &excluded_nodes) {