From 9677631bb2f3f1fef56fe65b2b81dbb3f66b1554 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Sun, 29 Nov 2020 12:37:11 +0100 Subject: [PATCH] error logging. --- src/documents/consumer.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index fba89d46c..7cdccc2e7 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -132,6 +132,9 @@ class Consumer(LoggingMixin): except ParseError as e: document_parser.cleanup() + self.log( + "error", + f"Error while consuming document {self.filename}: {e}") raise ConsumerError(e) # Prepare the document classifier. @@ -194,6 +197,11 @@ class Consumer(LoggingMixin): self.log("debug", "Deleting file {}".format(self.path)) os.unlink(self.path) except Exception as e: + self.log( + "error", + f"The following error occured while consuming " + f"{self.filename}: {e}" + ) raise ConsumerError(e) finally: document_parser.cleanup()