handle some networking errors

assume we are up to date if we can't fetch latest version
This commit is contained in:
2024-09-06 11:10:05 +02:00
parent d267d53c49
commit 3963f8fc9b
4 changed files with 30 additions and 13 deletions

View File

@@ -680,7 +680,11 @@ async fn main() {
let games_json =
http_async::get_body_string(format!("{}/games.json", MASTER.lock().unwrap()).as_str())
.await
.unwrap();
.unwrap_or_else(|error| {
crate::println_error!("Failed to get games.json: {:#?}", error);
misc::stdin();
std::process::exit(1);
});
let games: Vec<Game> = serde_json::from_str(&games_json).unwrap_or_else(|error| {
crate::println_error!("Error parsing games.json: {:#?}", error);
misc::stdin();