More error context when failing to invoke the rust toolchain

This commit is contained in:
Lukas Wirth 2023-08-09 14:09:37 +02:00
parent cba39f8553
commit 18b24f60d0

View file

@ -167,7 +167,8 @@ impl ProjectWorkspace {
cmd.envs(&config.extra_env); cmd.envs(&config.extra_env);
cmd.arg("--version").current_dir(current_dir); cmd.arg("--version").current_dir(current_dir);
cmd cmd
})?; })
.with_context(|| format!("Failed to query rust toolchain version at {current_dir}, is your toolchain setup correctly?"))?;
anyhow::Ok( anyhow::Ok(
cargo_version cargo_version
.get(prefix.len()..) .get(prefix.len()..)