httpd: Don't panic when node is not running

This commit is contained in:
Rūdolfs Ošiņš 2023-11-01 16:22:38 +01:00 committed by cloudhead
parent d8f8d29605
commit 342b05f88d
No known key found for this signature in database
1 changed files with 7 additions and 1 deletions

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,