Skip to content

Commit a7f221e

Browse files
authored
Don't panic on metadata errors (#100)
1 parent 8409d22 commit a7f221e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ pub fn build(args: Args, command_name: &str, crate_config: Option<Config>) -> Re
142142
cmd.manifest_path(manifest_path);
143143
}
144144

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

148150
// Fall back to manifest if config not explicitly specified

0 commit comments

Comments
 (0)