Skip to content

Commit deeb7a8

Browse files
committed
error message
1 parent 0680813 commit deeb7a8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tool/bundle/src/main.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,23 @@ fn bundle_crate(crate_name: &str, workspace_path: &Path) -> Result<String> {
171171
}
172172

173173
fn collect_crates(libs_path: &Path, crates: &mut HashMap<String, CrateInfo>) -> Result<()> {
174-
for entry in fs::read_dir(libs_path)? {
174+
if !libs_path.exists() {
175+
anyhow::bail!(
176+
"Libraries directory '{}' does not exist. Please check your workspace path.",
177+
libs_path.display()
178+
);
179+
}
180+
181+
if !libs_path.is_dir() {
182+
anyhow::bail!(
183+
"'{}' is not a directory. Expected a directory containing crate libraries.",
184+
libs_path.display()
185+
);
186+
}
187+
188+
for entry in fs::read_dir(libs_path)
189+
.with_context(|| format!("Failed to read directory '{}'", libs_path.display()))?
190+
{
175191
let entry = entry?;
176192
if entry.file_type()?.is_dir() {
177193
let crate_path = entry.path();

0 commit comments

Comments
 (0)