[JENKINS-43531] Plugins may not be expecting InvalidPathException

- Plugins should really be expecting it, but as historically they have not, may as well convert to IOE for them
This commit is contained in:
Stephen Connolly committed 2017-04-19 14:04:33 +01:00
1 parent 33942677d4
commit 3871d7778e
31 files changed
+209 -46

No files matched your search

+2 -1
View File
@@ -26,6 +26,7 @@ package hudson;
import hudson.security.ACLContext;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.StandardOpenOption;
import jenkins.util.SystemProperties;
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
@@ -278,7 +279,7 @@ public class WebAppMain implements ServletContextListener {
private void recordBootAttempt(File home) {
try (OutputStream o=Files.newOutputStream(BootFailure.getBootFailureFile(home).toPath(), StandardOpenOption.CREATE, StandardOpenOption.APPEND)) {
o.write((new Date().toString() + System.getProperty("line.separator", "\n")).toString().getBytes());
} catch (IOException e) {
} catch (IOException | InvalidPathException e) {
LOGGER.log(WARNING, "Failed to record boot attempts",e);
}
}