pdf2image icon indicating copy to clipboard operation
pdf2image copied to clipboard

Possibly Inaccurate Error Message

Open Matt-Munns opened this issue 4 years ago • 1 comments

https://github.com/Belval/pdf2image/blob/511ceab82be3a254ab3086a27f295df9be16cfa3/pdf2image/pdf2image.py#L466

This line will raise a PDFInfoNotInstalledError, with the message Unable to get page count. Is poppler installed and in PATH? for any OSError caught in the above try block. I was getting an error somewhere in that try block, but it was not due to pdfinfo not being installed. I actually successfully ran the code from tests.py that indicated that poppler is installed based on the successful calling of pdfinfo -h

I think it would be good to have a more descriptive error message showing the different possibilities that might be causing the OSError. Or at least some error message based on which the user doesn't think that poppler not being installed or on the path is necessarily the root cause.

Matt-Munns avatar Mar 05 '21 13:03 Matt-Munns

I am never against improving usability and giving the user a better error message. If you can give me a reproducible test case I'll be happy to fix the message.

Belval avatar Mar 06 '21 20:03 Belval