only: better error handling

This commit is contained in:
rusefillc 2024-03-09 17:39:11 -05:00
parent 50746557b3
commit e354181d6c
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,11 @@ public class XmlUtil {
JAXBContext jaxbContext;
jaxbContext = JAXBContext.newInstance(modelClass);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
return (T) jaxbUnmarshaller.unmarshal(xmlFile);
try {
return (T) jaxbUnmarshaller.unmarshal(xmlFile);
} catch (Throwable e) {
throw new IllegalStateException("While reading " + xmlFile.getAbsolutePath(), e);
}
}
/**