diff options
author | Frederick Muriuki Muriithi | 2022-04-13 12:37:38 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-04-13 12:37:38 +0300 |
commit | 6804b610266d0804dd5c391f5171943429c285cd (patch) | |
tree | acb7fc41565144fe408c7947bf8ed4cf5235a3f0 /quality_control | |
parent | aa6bdfc390a22734cfd356a45b99a8cf2032e992 (diff) | |
download | gn-uploader-6804b610266d0804dd5c391f5171943429c285cd.tar.gz |
Check for `DuplicateHeader` errors in `parse_file` function
Diffstat (limited to 'quality_control')
-rw-r--r-- | quality_control/parsing.py | 4 |
1 files 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, |