Skip to content

Commit

Permalink
give a better error if renaming a temp file fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Dec 9, 2023
1 parent 270d545 commit 118b6e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bootstrap/src/core/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ impl Config {
Some(other) => panic!("unsupported protocol {other} in {url}"),
None => panic!("no protocol in {url}"),
}
t!(std::fs::rename(&tempfile, dest_path));
t!(
std::fs::rename(&tempfile, dest_path),
format!("failed to rename {tempfile:?} to {dest_path:?}")
);
}

fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
Expand Down Expand Up @@ -570,6 +573,10 @@ impl Config {
key: &str,
destination: &str,
) {
if self.dry_run() {
return;
}

let cache_dst = self.out.join("cache");
let cache_dir = cache_dst.join(key);
if !cache_dir.exists() {
Expand Down

0 comments on commit 118b6e4

Please sign in to comment.