Skip to content

Commit 16259b8

Browse files
runeflobakkSimen Støa
authored andcommitted
Catch all exceptions when trying to create Schema
1 parent 0401ee0 commit 16259b8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

jaxb/src/main/java/no/digipost/signature/jaxb/JaxbMarshaller.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717

1818
import no.digipost.signature.xsd.SignatureApiSchemas;
1919
import org.xml.sax.InputSource;
20-
import org.xml.sax.SAXException;
2120
import org.xml.sax.XMLReader;
2221

2322
import javax.xml.XMLConstants;
2423
import javax.xml.bind.JAXBContext;
2524
import javax.xml.bind.JAXBException;
2625
import javax.xml.bind.Marshaller;
2726
import javax.xml.bind.Unmarshaller;
28-
import javax.xml.parsers.ParserConfigurationException;
2927
import javax.xml.parsers.SAXParser;
3028
import javax.xml.parsers.SAXParserFactory;
3129
import javax.xml.transform.Source;
@@ -158,7 +156,7 @@ private static Schema createSchema(Collection<String> resources) {
158156
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
159157
Schema schema = schemaFactory.newSchema(schemaSources);
160158
return schema;
161-
} catch (SAXException | ParserConfigurationException e) {
159+
} catch (Exception e) {
162160
throw new RuntimeException("Could not create schema from resources [" + String.join(", ", resources) + "]", e);
163161
}
164162
}

0 commit comments

Comments
 (0)