From b0ac9bdf61b91dd6683da65b544cc52b2320bd45 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Wed, 21 Feb 2024 10:09:03 +0100 Subject: [PATCH] misc: more error reporting in self-update --- src/cli/self_update.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs index f41634647..d5bf15ff0 100644 --- a/src/cli/self_update.rs +++ b/src/cli/self_update.rs @@ -6,7 +6,7 @@ use std::{ use flate2::read::GzDecoder; use tar::Archive; -use miette::IntoDiagnostic; +use miette::{Context, IntoDiagnostic}; use reqwest::Client; use serde::Deserialize; @@ -211,15 +211,28 @@ async fn retrieve_target_version(version: &Option) -> miette::Result(&body).into_diagnostic() + serde_json::from_str::(&body) + .into_diagnostic() + .with_context(|| format!("Failed to parse the Release from github: {:#?}", body)) } fn pixi_binary_name() -> String {