httpd: Don't panic when node is not running

This commit is contained in:
Rūdolfs Ošiņš
2023-11-02 17:00:38 +01:00
committed by cloudhead
parent c1a026fc81
commit cb1e7f361d
+7 -1
View File
@@ -26,7 +26,13 @@ async fn node_handler(State(ctx): State<Context>) -> 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,