Commit 8b3ec480 by eguven Committed by Oliver Woodman

Set cause of the exceptions in AtomicFile.startWrite()

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173388899
parent 3c201a04
...@@ -104,12 +104,12 @@ public final class AtomicFile { ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment