From 9bace8d8c55ce7ee7e480de703f22195f35e3b8e Mon Sep 17 00:00:00 2001 From: Empire Date: Thu, 20 Mar 2025 22:46:17 +0100 Subject: [PATCH] fix error when no backup --- rust/src/webserver/webserver.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rust/src/webserver/webserver.rs b/rust/src/webserver/webserver.rs index 625c8f0..b6caaf5 100644 --- a/rust/src/webserver/webserver.rs +++ b/rust/src/webserver/webserver.rs @@ -188,7 +188,14 @@ fn backup_info( }; serde_json::to_string(&wbh)? } - Err(_) => "{\"error\":\"Header could not be parsed\"".to_owned(), + Err(_) => { + //TODO make better + let wbh = WebBackupHeader { + timestamp: "no backup".to_owned(), + size: 0, + }; + serde_json::to_string(&wbh)? + } }; anyhow::Ok(Some(json)) }