diff --git a/explorer-api/src/mix_node/http.rs b/explorer-api/src/mix_node/http.rs index 8cad0e4ee6..d605379480 100644 --- a/explorer-api/src/mix_node/http.rs +++ b/explorer-api/src/mix_node/http.rs @@ -38,18 +38,19 @@ async fn get_mix_node_description(host: &str, port: u16) -> Result() .await { - return Ok(description.into()); + Ok(description) => return Ok(description.into()), + Err(e) => log::warn!("Failed to parse old model description: {}", e), } let second_url = format!("http://{host}:{port}/api/v1/description"); let second_response = reqwest::get(&second_url).await.context(format!( - "Failed to fetch description from /api/v1/description nym-node url: {}", + "Failed to fetch description from nym-node /api/v1/description url: {}", second_url ))?; @@ -62,6 +63,7 @@ async fn get_mix_node_description(host: &str, port: u16) -> Result Result { let primary_url = format!("http://{host}:{port}/stats"); let secondary_url = format!("http://{host}:{port}/api/v1/metrics/mixing"); @@ -69,12 +71,14 @@ pub async fn get_mix_node_stats(host: &str, port: u16) -> Result { let primary_response = reqwest::get(&primary_url) .await .context("Failed to fetch from primary nym-mixnode /stats url")?; - if let Ok(stats) = primary_response + let primary_stats = primary_response .error_for_status() .context("Nym-mixnode url returned error status")? .json::() .await - { + .context("Failed to parse JSON from primary nym-mixnode /stats url"); + + if let Ok(stats) = primary_stats { return Ok(stats); }