deanmalmgren / textract

extract text from any document. no muss. no fuss.
http://textract.readthedocs.io
MIT License
3.89k stars 599 forks source link

Fix exception error message #335

Open wajdikhattel opened 4 years ago

wajdikhattel commented 4 years ago

Describe the bug When you don't have one of the dependencies of the parsers installed, you will get the ExtensionNotSupported exception even though the extension exists. Example (#333): with .pptx and not having the package Image:

ExtensionNotSupported: The filename extension .pptx is not yet supported by
textract. Please suggest this filename extension here:

https://github.com/deanmalmgren/textract/issues
Available extensions include: .csv, .doc, .docx, .eml, .epub, .gif, .htm, .html, .jpeg, .jpg, .json, .log, .mp3, .msg, .odt, .ogg, .pdf, .png, .pptx, .ps, .psv, .rtf, .tff, .tif, .tiff, .tsv, .txt, .wav, .xls, .xlsx

To Reproduce

  1. Use a supported extension (.pptx for example)
  2. Have one of the dependencies of that extension's parser not installed (Image for example)
  3. Run the textract.process(...) function
  4. See the error telling you that the extension is not supported

Expected behavior An error saying that you need to install the missing dependency.

Desktop (please complete the following information):