Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

error logging.

jonaswinkler9677631bb2f3
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()