write games.json content to file on error
This commit is contained in:
parent
bd26533ae2
commit
bb66366f41
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -19,7 +19,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "alterware-launcher"
|
||||
version = "0.6.8"
|
||||
version = "0.6.9"
|
||||
dependencies = [
|
||||
"colored",
|
||||
"futures-util",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "alterware-launcher"
|
||||
version = "0.6.8"
|
||||
version = "0.6.9"
|
||||
edition = "2021"
|
||||
build = "res/build.rs"
|
||||
|
||||
|
@ -595,7 +595,12 @@ async fn main() {
|
||||
let games_json = http_async::get_body_string(format!("{}/games.json", master_url).as_str())
|
||||
.await
|
||||
.unwrap();
|
||||
let games: Vec<Game> = serde_json::from_str(&games_json).unwrap();
|
||||
let games: Vec<Game> = serde_json::from_str(&games_json).unwrap_or_else(|error| {
|
||||
println!("Error parsing games.json: {:#?}", error);
|
||||
fs::write("alterware-launcher-error.txt", &games_json).unwrap();
|
||||
misc::stdin();
|
||||
std::process::exit(1);
|
||||
});
|
||||
|
||||
let mut game: String = String::new();
|
||||
if args.len() > 1 {
|
||||
|
Loading…
Reference in New Issue
Block a user