Add more logging to the ocr app's document parsers. Issue #152
This commit is contained in:
@@ -90,7 +90,8 @@ class SlateParser(Parser):
|
||||
descriptor.close()
|
||||
|
||||
if pdf_pages[document_page.page_number - 1] == b'\x0c':
|
||||
raise ParserError
|
||||
logger.debug('The Slate parser didn\'t return any output')
|
||||
raise ParserError('No output')
|
||||
|
||||
document_page.content = pdf_pages[document_page.page_number - 1]
|
||||
document_page.page_label = _('Text extracted from PDF')
|
||||
@@ -166,7 +167,7 @@ class PopplerParser(Parser):
|
||||
|
||||
output = proc.stdout.read()
|
||||
if output == b'\x0c':
|
||||
logger.debug('Parser didn\'t any output')
|
||||
logger.debug('Parser didn\'t return any output')
|
||||
raise ParserError('No output')
|
||||
|
||||
document_page.content = output
|
||||
|
||||
Reference in New Issue
Block a user