fix error when no backup

This commit is contained in:
Empire 2025-03-20 22:46:17 +01:00
parent 16756aba94
commit 9bace8d8c5

View File

@ -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))
}