Skip to content

Commit f5b28cf

Browse files
dlzhry2nhsmfjarvis
authored andcommitted
VED-769 Minor fixes for batch - reduce error noise and increase empty file size (#823)
1 parent e93f8e9 commit f5b28cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

filenameprocessor/src/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737

3838
# The size in bytes of an empty batch file containing only the headers row
39-
EMPTY_BATCH_FILE_SIZE_IN_BYTES = 615
39+
EMPTY_BATCH_FILE_SIZE_IN_BYTES = 700
4040

4141

4242
class FileStatus(StrEnum):

filenameprocessor/src/file_name_processor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ def handle_record(record) -> dict:
114114
UnhandledSqsError,
115115
Exception,
116116
) as error:
117-
logger.error("Error processing file '%s': %s", file_key, str(error))
117+
if isinstance(error, EmptyFileError):
118+
# Avoid error log noise for accepted scenario in which supplier provides a batch file with no records
119+
logger.warning("Error processing file '%s': %s", file_key, str(error))
120+
else:
121+
logger.error("Error processing file '%s': %s", file_key, str(error))
118122

119123
file_status = FileStatus.PROCESSED
120124
if isinstance(error, DuplicateFileError):

0 commit comments

Comments
 (0)