Skip to content

Commit f8d6d16

Browse files
committed
UnicodeDecodeError
1 parent 772d52f commit f8d6d16

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

recordprocessor/src/file_level_validation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,12 @@ def file_level_validation(incoming_message_body: dict) -> dict:
8282
try:
8383
csv_reader = get_csv_content_dict_reader(file_key, encoder=encoder)
8484
validate_content_headers(csv_reader)
85-
except Exception as e:
85+
except UnicodeDecodeError as e:
8686
if hasattr(e, 'reason') and e.reason == "invalid continuation byte" and encoder == "utf-8":
8787
logger.warning("Invalid Encoding detected: %s", e)
8888
# retry with cp1252 encoding
8989
csv_reader = get_csv_content_dict_reader(file_key, encoder="cp1252")
9090
validate_content_headers(csv_reader)
91-
else:
92-
raise
9391

9492
# Validate has permission to perform at least one of the requested actions
9593
allowed_operations_set = get_permitted_operations(supplier, vaccine, permission)

0 commit comments

Comments
 (0)