https://bz.apache.org/bugzilla/show_bug.cgi?id=64274
Bug ID: 64274 Summary: ExtractorFactory#createExtractor shall throw POIXMLException Product: POI Version: 4.1.x-dev Hardware: PC Status: NEW Severity: normal Priority: P2 Component: POI Overall Assignee: dev@poi.apache.org Reporter: zhong...@pku.org.cn Target Milestone: --- When OOXML file is invalid, org.apache.poi.ooxml.extractor.ExtractorFactory#createExtractor throws IllegalArgumentException: public static POITextExtractor createExtractor(OPCPackage pkg) throws IOException, OpenXML4JException, XmlException { ... if (core.size() != 1) { throw new IllegalArgumentException("Invalid OOXML Package received - expected 1 core document, found " + core.size()); } } POI already implements POIXMLException for this type of problem. Other methods all throw this exception: org.apache.poi.ooxml.POIXMLDocumentPart.RelationPart#getPartFromOPCPackage org.apache.poi.ooxml.POIXMLDocumentPart.RelationPart#getPartFromOPCPackage org.apache.poi.xssf.eventusermodel.XSSFReader#XSSFReader Please update the exception of createExtractor, so it is easier to catch this type of problems. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org