Skip to content

Commit ceac419

Browse files
committed
add detailed message when target folder path is invalid
1 parent 0871c0e commit ceac419

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/cargo-util/src/paths.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,8 @@ pub fn create_dir_all_excluded_from_backups_atomic(p: impl AsRef<Path>) -> Resul
694694
// we can infer from it's another cargo process doing work.
695695
if let Err(e) = fs::rename(tempdir.path(), path) {
696696
if !path.exists() {
697-
return Err(anyhow::Error::from(e));
697+
return Err(anyhow::Error::from(e))
698+
.with_context(|| format!("failed to create directory `{}`", path.display()));
698699
}
699700
}
700701
Ok(())

0 commit comments

Comments
 (0)