Closed cnluzon closed 1 year ago
I think the
make_groups_from_barcodes_and_reads
should be the function raising an exception if input is not valid, but I also think it is not so nice if the user gets an output with an entire Traceback and all, so I put it on a try/catch block, but still printed the message coming from it in aCommandLineError
, which I am unsure if it is the best way to do.
This is IMO the right way to do it: The function itself should juts raise an appropriate exception, and then the actual command-line code (main
or run_init
in this case) catches it and converts it to a CommandLineError. This separates responsibilities nicely: The function doesn’t need to even know that it is being run from the command line. And main()
can take the exception and its message and make it nicer to read.
I mistakenly left out validation of
--input
onminute init
. So the command would run, and generate invalidgroups.tsv
file. So now:--barcodes
is provided but--input
is not.--input
does not match the prefix of any of the .fastq.gz files in the--reads
directory.I think the
make_groups_from_barcodes_and_reads
should be the function raising an exception if input is not valid, but I also think it is not so nice if the user gets an output with an entire Traceback and all, so I put it on a try/catch block, but still printed the message coming from it in aCommandLineError
, which I am unsure if it is the best way to do.