Skip to content

Commit

Permalink
Log when we can't use an existing tempdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Emann committed Jan 9, 2024
1 parent a183537 commit 5a6da80
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/applesauce/src/tmpdir_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ impl TmpdirPaths {
let device = metadata.st_dev();
let dir = match self.dirs.get(&device) {
Some(dir) => dir.path(),
None => path
.parent()
.ok_or_else(|| io::Error::other("expected path to have a parent"))?,
None => {
let parent = path
.parent()
.ok_or_else(|| io::Error::other("expected path to have a parent"))?;
tracing::info!(
"no temp dir for device {device} found, creating file in {parent:?}"
);
parent
}
};

let mut builder = tempfile::Builder::new();
Expand Down

0 comments on commit 5a6da80

Please sign in to comment.