diff --git a/core/src/main/java/hudson/util/TextFile.java b/core/src/main/java/hudson/util/TextFile.java index 104ad9198d..97fd5bd00c 100644 --- a/core/src/main/java/hudson/util/TextFile.java +++ b/core/src/main/java/hudson/util/TextFile.java @@ -53,8 +53,13 @@ public class TextFile { public void write(String text) throws IOException { file.getParentFile().mkdirs(); AtomicFileWriter w = new AtomicFileWriter(file); - w.write(text); - w.commit(); + try { + w.write(text); + w.commit(); + } catch (IOException e) { + w.abort(); + throw e; + } } public String readTrim() throws IOException {