From 342b05f88d0ab9e81b03db9427b1d641cc5cb749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 1 Nov 2023 16:22:38 +0100 Subject: [PATCH] httpd: Don't panic when node is not running --- radicle-httpd/src/api/v1/node.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/radicle-httpd/src/api/v1/node.rs b/radicle-httpd/src/api/v1/node.rs index f7de8aee1..e284726e2 100644 --- a/radicle-httpd/src/api/v1/node.rs +++ b/radicle-httpd/src/api/v1/node.rs @@ -26,7 +26,13 @@ async fn node_handler(State(ctx): State) -> impl IntoResponse { } else { "stopped" }; - let config = node.config()?; + let config = match node.config() { + Ok(config) => Some(config), + Err(err) => { + tracing::error!("Error getting node config: {:#}", err); + None + } + }; let response = json!({ "id": node_id.to_string(), "config": config,