A bit more context for errors

This commit is contained in:
IQuant 2024-08-23 00:45:12 +03:00
parent 140aae3598
commit 86e21ad271
4 changed files with 21 additions and 7 deletions

View file

@ -1993,7 +1993,7 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]]
name = "noita-proxy"
version = "0.21.2"
version = "0.21.3"
dependencies = [
"argh",
"bincode",

View file

@ -5,7 +5,7 @@ resolver = "2"
[package]
name = "noita-proxy"
description = "Noita Entangled Worlds companion app."
version = "0.21.2"
version = "0.21.3"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -328,10 +328,24 @@ fn mod_downloader_for(
.timeout(None)
.build()
.wrap_err("Failed to build client")?;
get_release_by_tag(&client, tag)
.and_then(|release| release.get_release_assets(&client).wrap_err(""))
.and_then(|asset_list| asset_list.find_by_name("quant.ew.zip").cloned())
.and_then(|asset| asset.download(&client, &download_path))
get_release_by_tag(&client, tag.clone())
.wrap_err_with(|| format!("while getting release for tag {:?}", tag))
.and_then(|release| {
release
.get_release_assets(&client)
.wrap_err("while getting release assets")
})
.and_then(|asset_list| {
asset_list
.find_by_name("quant.ew.zip")
.cloned()
.wrap_err("while finding asset by name")
})
.and_then(|asset| {
asset
.download(&client, &download_path)
.wrap_err("while creating a downloader")
})
.wrap_err("Failed to download mod")
}

View file

@ -135,7 +135,7 @@ impl AssetList {
}
}
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Clone)]
pub struct Tag(String);
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]