From 18b24f60d0423a7b88978ca08bcfca4a905583d1 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 9 Aug 2023 14:09:37 +0200 Subject: [PATCH] More error context when failing to invoke the rust toolchain --- crates/project-model/src/workspace.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs index f51ea7eeb22..13463e9f72e 100644 --- a/crates/project-model/src/workspace.rs +++ b/crates/project-model/src/workspace.rs @@ -167,7 +167,8 @@ fn load_inner( cmd.envs(&config.extra_env); cmd.arg("--version").current_dir(current_dir); cmd - })?; + }) + .with_context(|| format!("Failed to query rust toolchain version at {current_dir}, is your toolchain setup correctly?"))?; anyhow::Ok( cargo_version .get(prefix.len()..)