Skip to content

Commit

Permalink
ValueException if wrong extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzalab committed Dec 9, 2024
1 parent 6b32f17 commit fc07d07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fastqwiper/fastq_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions fastqwiper/fastq_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("_", ".")
Expand Down

0 comments on commit fc07d07

Please sign in to comment.