Do not use ISE in XmlNormalizedNodeBodyWriter
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / XmlNormalizedNodeBodyWriter.java
index 54c044e311473d871e4cb01b06e24a798c6363ac..4b3dbc61992078199b23ab540d5f6f917b5734c5 100644 (file)
@@ -88,12 +88,12 @@ public final class XmlNormalizedNodeBodyWriter extends AbstractNormalizedNodeBod
     }
 
     private static XMLStreamWriter createXmlWriter(final OutputStream entityStream,
-            final @Nullable PrettyPrintParam prettyPrint) {
+            final @Nullable PrettyPrintParam prettyPrint) throws IOException {
         final XMLStreamWriter xmlWriter;
         try {
             xmlWriter = XML_FACTORY.createXMLStreamWriter(entityStream, StandardCharsets.UTF_8.name());
         } catch (XMLStreamException | FactoryConfigurationError e) {
-            throw new IllegalStateException(e);
+            throw new IOException(e);
         }
 
         return prettyPrint != null && prettyPrint.value() ? new IndentingXMLStreamWriter(xmlWriter) : xmlWriter;