Skip to content

Commit

Permalink
Don't panic on metadata errors (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte authored Dec 28, 2020
1 parent 8409d22 commit a7f221e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ pub fn build(args: Args, command_name: &str, crate_config: Option<Config>) -> Re
cmd.manifest_path(manifest_path);
}

let metadata = cmd.exec().expect("cargo metadata invocation failed");
let metadata = cmd
.exec()
.map_err(|e| anyhow!("cargo metadata invocation failed: {}", e))?;
let root = Path::new(&metadata.workspace_root);

// Fall back to manifest if config not explicitly specified
Expand Down

0 comments on commit a7f221e

Please sign in to comment.