Properly raise PageCountError when unable to determine a document's page count.

This commit is contained in:
Roberto Rosario
2015-08-06 02:57:02 -04:00
parent 960d60c39d
commit 2f030ab162

View File

@@ -94,6 +94,10 @@ class Python(ConverterBase):
else:
try:
image = Image.open(self.file_object)
except IOError as exception:
error_message = _('Exception determining PDF page count; %s') % exception
logger.error(error_message)
raise PageCountError(error_message)
finally:
self.file_object.seek(0)