Skip to content

Commit

Permalink
[#4] Add logs when unable to create bundle temp directory (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko authored May 8, 2024
1 parent 05a02d8 commit 4f200cf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,16 @@ private File getBundleTempDir() throws IOException {
if (!tempDir.exists()) {
throw new IOException("Temporary directory " + tempDir + " does not exist");
}
if (!tempDir.canWrite()) {
throw new IOException("Temporary directory " + tempDir + " is read/only");
}
File candidate;
do {
candidate = new File(tempDir, "bundle-" + nextRandom());
} while (!candidate.mkdir());
} while (candidate.exists());
if (!candidate.mkdir()) {
throw new IOException("Temporary directory " + tempDir + " is read/only");
}
candidate.deleteOnExit();
_bundleTempDir = candidate;
return candidate;
Expand Down

0 comments on commit 4f200cf

Please sign in to comment.