From fc07d07595a8bd1725b6479a92841555231275a3 Mon Sep 17 00:00:00 2001 From: mazzalab Date: Mon, 9 Dec 2024 21:25:32 +0100 Subject: [PATCH] ValueException if wrong extensions --- fastqwiper/fastq_gather.py | 1 + fastqwiper/fastq_scatter.py | 1 + 2 files changed, 2 insertions(+) diff --git a/fastqwiper/fastq_gather.py b/fastqwiper/fastq_gather.py index eef4c67..57dc433 100644 --- a/fastqwiper/fastq_gather.py +++ b/fastqwiper/fastq_gather.py @@ -33,6 +33,7 @@ def files_choices(choices, fname): if ext not in choices: parser.error(f"File '{fname}' doesn't end with one of {choices}") + raise ValueError(f"File '{fname}' doesn't end with one of {choices}") return fname parser.add_argument( diff --git a/fastqwiper/fastq_scatter.py b/fastqwiper/fastq_scatter.py index 0becc40..7f81554 100644 --- a/fastqwiper/fastq_scatter.py +++ b/fastqwiper/fastq_scatter.py @@ -35,6 +35,7 @@ def file_choices(choices, fname): if ext not in choices: parser.error( f"File '{fname}' doesn't end with one of {choices}") + raise ValueError(f"File '{fname}' doesn't end with one of {choices}") return fname parser.add_argument("-f", "--fastq", type=lambda s: file_choices((e.name.lower().replace("_", ".")