diff --git a/core/src/main/java/hudson/XmlFile.java b/core/src/main/java/hudson/XmlFile.java index d5077b34db4c6c082c880ed60d30f7c9de7136bb..16644262b97020aa502dd7f0862d6e20561b4761 100644 --- a/core/src/main/java/hudson/XmlFile.java +++ b/core/src/main/java/hudson/XmlFile.java @@ -24,10 +24,8 @@ package hudson; import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.XStreamException; import com.thoughtworks.xstream.converters.Converter; import com.thoughtworks.xstream.converters.UnmarshallingContext; -import com.thoughtworks.xstream.io.StreamException; import com.thoughtworks.xstream.io.xml.Xpp3Driver; import hudson.diagnosis.OldDataMonitor; import hudson.model.Descriptor; @@ -148,7 +146,7 @@ public final class XmlFile { } try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) { return xs.fromXML(in); - } catch (XStreamException | Error | InvalidPathException e) { + } catch (RuntimeException | Error e) { throw new IOException("Unable to read "+file,e); } } @@ -165,7 +163,7 @@ public final class XmlFile { try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) { // TODO: expose XStream the driver from XStream return xs.unmarshal(DEFAULT_DRIVER.createReader(in), o); - } catch (XStreamException | Error | InvalidPathException e) { + } catch (RuntimeException | Error e) { throw new IOException("Unable to read "+file,e); } } @@ -184,7 +182,7 @@ public final class XmlFile { writing.set(null); } w.commit(); - } catch(StreamException e) { + } catch(RuntimeException e) { throw new IOException(e); } finally { w.abort();