From 569beba348c7435c5d05b92b9b9db66c944f5bf4 Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Fri, 5 Jan 2024 20:07:31 -0800 Subject: [PATCH] Fixes a random crash in the barcode ASN reading so it doesn't try to access a not created temp dir --- src/documents/barcodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/documents/barcodes.py b/src/documents/barcodes.py index 005531107..5a2c3381a 100644 --- a/src/documents/barcodes.py +++ b/src/documents/barcodes.py @@ -90,6 +90,9 @@ class BarcodeReader: """ asn = None + if not self.supported_mime_type: + return None + # Ensure the barcodes have been read self.detect() @@ -215,7 +218,7 @@ class BarcodeReader: # This file is really borked, allow the consumption to continue # but it may fail further on except Exception as e: # pragma: no cover - logger.warning( + logger.exception( f"Exception during barcode scanning: {e}", )