aboutsummaryrefslogtreecommitdiff
path: root/quality_control
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-04-13 12:37:38 +0300
committerFrederick Muriuki Muriithi2022-04-13 12:37:38 +0300
commit6804b610266d0804dd5c391f5171943429c285cd (patch)
treeacb7fc41565144fe408c7947bf8ed4cf5235a3f0 /quality_control
parentaa6bdfc390a22734cfd356a45b99a8cf2032e992 (diff)
downloadgn-uploader-6804b610266d0804dd5c391f5171943429c285cd.tar.gz
Check for `DuplicateHeader` errors in `parse_file` function
Diffstat (limited to 'quality_control')
-rw-r--r--quality_control/parsing.py4
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,