Matthew Caruana Galizia created TIKA-2221:
---------------------------------------------
Summary: poi.EncryptedDocumentException not wrapped in
tika.exception.EncryptedDocumentException
Key: TIKA-2221
URL: https://issues.apache.org/jira/browse/TIKA-2221
Project: Tika
Issue Type: Bug
Affects Versions: 1.14
Reporter: Matthew Caruana Galizia
Priority: Minor
Fix For: 1.15
When parsing an encrypted Word document, a
org.apache.poi.EncryptedDocumentException is thrown at WordExtractor.java#151.
Tika catches this too far up the stack and incorrectly wraps it in a plain
TikaException instead of a org.apache.tika.exception.EncryptedDocumentException.
The fix would be to catch and wrap the exception correctly, for example:
{noformat}
try {
document = new HWPFDocument(root);
} catch (org.apache.poi.EncryptedDocumentException e) {
throw new EncryptedDocumentException(e);
} catch (OldWordFileFormatException e) {
parseWord6(root, xhtml);
return;
}
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)