mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Set cause of the exceptions in AtomicFile.startWrite()
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173388899
This commit is contained in:
parent
3c201a0491
commit
8b3ec4800c
1 changed files with 2 additions and 2 deletions
|
|
@ -104,12 +104,12 @@ public final class AtomicFile {
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
File parent = baseName.getParentFile();
|
File parent = baseName.getParentFile();
|
||||||
if (!parent.mkdirs()) {
|
if (!parent.mkdirs()) {
|
||||||
throw new IOException("Couldn't create directory " + baseName);
|
throw new IOException("Couldn't create directory " + baseName, e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
str = new AtomicFileOutputStream(baseName);
|
str = new AtomicFileOutputStream(baseName);
|
||||||
} catch (FileNotFoundException e2) {
|
} catch (FileNotFoundException e2) {
|
||||||
throw new IOException("Couldn't create " + baseName);
|
throw new IOException("Couldn't create " + baseName, e2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue