httpd: Don't panic when node is not running
This commit is contained in:
parent
d8f8d29605
commit
342b05f88d
|
|
@ -26,7 +26,13 @@ async fn node_handler(State(ctx): State<Context>) -> impl IntoResponse {
|
||||||
} else {
|
} else {
|
||||||
"stopped"
|
"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!({
|
let response = json!({
|
||||||
"id": node_id.to_string(),
|
"id": node_id.to_string(),
|
||||||
"config": config,
|
"config": config,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue