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

@@ -450,11 +450,18 @@ class Consumer(LoggingMixin):
archive_path = document_parser.get_archive_path()
except ParseError as e:
self._fail(
str(e),
f"Error occurred while consuming document {self.filename}: {e}",
exc_info=True,
exception=e,
)
except Exception as e:
document_parser.cleanup()
tempdir.cleanup()
self._fail(
str(e),
f"Error while consuming document {self.filename}: {e}",
f"Unexpected error while consuming document {self.filename}: {e}",
exc_info=True,
exception=e,
)
@@ -544,8 +551,8 @@ class Consumer(LoggingMixin):
except Exception as e:
self._fail(
str(e),
f"The following error occurred while consuming "
f"{self.filename}: {e}",
f"The following error occurred while storing document "
f"{self.filename} after consuming: {e}",
exc_info=True,
exception=e,
)