Fix: ghostscript rendering error doesnt trigger frontend failure message (#4092)

* Raise ParseError from gs rendering error

* catch all parser errors as generic exception

* Differentiate generic vs parse errors during consumption
This commit is contained in:
shamoon
2023-08-31 19:49:00 -07:00
committed by GitHub
parent 407a119b9a
commit e14f4c94c2
4 changed files with 70 additions and 6 deletions

View File

@@ -340,7 +340,10 @@ class RasterisedDocumentParser(DocumentParser):
"Ghostscript PDF/A rendering failed, consider setting "
"PAPERLESS_OCR_USER_ARGS: '{\"continue_on_soft_render_error\": true}'", # noqa: E501
)
raise e
raise ParseError(
f"SubprocessOutputError: {e!s}. See logs for more information.",
) from e
except (NoTextFoundException, InputFileError) as e:
self.log.warning(
f"Encountered an error while running OCR: {e!s}. "