Skip to content

Commit f74c39a

Browse files
committed
Enhance error output on missing Cargo.lock
Contributes-To: lukaslueg#32
1 parent a5912fc commit f74c39a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,14 @@ impl CIPlatform {
343343

344344
fn get_build_deps(manifest_location: &path::Path) -> io::Result<Vec<(String, String)>> {
345345
let mut lock_buf = String::new();
346-
fs::File::open(manifest_location.join("Cargo.lock"))?.read_to_string(&mut lock_buf)?;
346+
fs::File::open(manifest_location.join("Cargo.lock"))
347+
.map_err(|i| {
348+
std::io::Error::new(
349+
i.kind(),
350+
"No Cargo.lock file found, see set_dependencies documentation",
351+
)
352+
})?
353+
.read_to_string(&mut lock_buf)?;
347354
Ok(parse_dependencies(&lock_buf))
348355
}
349356

0 commit comments

Comments
 (0)