}
catch ( Throwable jenaExc ) {
// XML parse exception?
String errorMessage = getXmlParseExceptionErrorMessage(jenaExc);
if ( errorMessage != null ) {
throw new IOExceptionWithCause(errorMessage, jenaExc);
}
// the following verifyUtf8 was done before I wrote and called the getXmlParseExceptionErrorMessage
// method above; just keeping the verifyUtf8 here although perhaps it's redundant:
// perhaps because not UTF-8? Try the check directly:
try {
Utf8Util.verifyUtf8(file);
}
catch (Exception utfExc) {
// yes, it seems the problem is the encoding"
String error = jenaExc.getMessage();
throw new IOExceptionWithCause(error, utfExc);
}
// other kind of problem:
String error = jenaExc.getClass().getName()+ " : " +jenaExc.getMessage();
throw new IOExceptionWithCause(error, jenaExc);
}
}