From 6804b610266d0804dd5c391f5171943429c285cd Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 13 Apr 2022 12:37:38 +0300 Subject: Check for `DuplicateHeader` errors in `parse_file` function --- quality_control/parsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quality_control/parsing.py b/quality_control/parsing.py index eda9181..b7b0ff5 100644 --- a/quality_control/parsing.py +++ b/quality_control/parsing.py @@ -6,7 +6,7 @@ import quality_control.average as avg import quality_control.standard_error as se from quality_control.headers import valid_header from quality_control.errors import ( - ParseError, InvalidCellValue, InvalidHeaderValue) + ParseError, DuplicateHeader, InvalidCellValue, InvalidHeaderValue) class FileType(Enum): AVERAGE = 1 @@ -57,7 +57,7 @@ def parse_file(filepath: str, filetype: FileType, strains_filepath: str): yield LINE_PARSERS[filetype]( tuple(field.strip() for field in line.split("\t"))) seek_pos = seek_pos + len(line) - except (InvalidCellValue, InvalidHeaderValue) as err: + except (DuplicateHeader, InvalidCellValue, InvalidHeaderValue) as err: raise ParseError({ "filepath": filepath, "filetype": filetype, -- cgit v1.2.3