fix: ensure that ws loading error includes path to ws

This commit is contained in:
Alex Kladov 2023-06-19 12:32:04 +01:00
parent 00b9d9faf4
commit 49318bbae7
4 changed files with 30 additions and 2 deletions

View file

@ -151,6 +151,15 @@ impl ProjectWorkspace {
manifest: ProjectManifest,
config: &CargoConfig,
progress: &dyn Fn(String),
) -> Result<ProjectWorkspace> {
ProjectWorkspace::load_inner(&manifest, config, progress)
.with_context(|| format!("Failed to load the project at {manifest}"))
}
fn load_inner(
manifest: &ProjectManifest,
config: &CargoConfig,
progress: &dyn Fn(String),
) -> Result<ProjectWorkspace> {
let version = |current_dir, cmd_path, prefix: &str| {
let cargo_version = utf8_stdout({