usadellab / prot-scriber

Assigns short human readable descriptions to biological sequences or gene families using references. For this, prot-scriber consumes sequence similarity search results in tabular format (Blast or Diamond).
GNU General Public License v3.0
7 stars 5 forks source link

Improve error messages' print out #31

Closed asishallab closed 2 years ago

asishallab commented 2 years ago

If input arguments are not given in the required format, prot-scriber prints an informative error message. However the message appears in the middle of "exception-like" error reporting and thus is overlooked easily. Reproduce e.g. by giving a wrong number of -l args for a given number of -s args.

Please improve the error message printing, so they are more easily spotted and understood.

coeit commented 2 years ago

I think putting the actual error message in between newlines \n\n<error message>\n\n could already be sufficient.

We could also add a permalink to the manual section for the command line argument that was used incorrectly. Message could look like this

>> ./prot-scriber -o test.out -s /home/cons/projects/galaxy/galaxy/test-data/8_Proteins_vs_Swissprot_blastp.txt -s /home/cons/projects/galaxy/galaxy/test-data/8_Proteins_vs_Trembl_blastp.txt -l ../../misc/filter_stitle_regexs_UniRef.txt
thread 'main' panicked at '

Cannot run Annotation-Process, because got 2 sequence similarity search result tables (SSSTs), but 1 --filter-regexs (-l). Please provide either no --filter-regexs, causing the default to be used for all SSSTs, or provide one --filter-regexs (-l) argument for each of your input SSSTs. See --help or the following link for more details.

https://github.com/usadellab/prot-scriber/blob/880d32bab31ab5d0b2a3708a9faec8f37b53be9b/README.md?plain=1#L201-L213

', src/annotation_process.rs:718:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

A url like the one above would link directly to the README with the specific lines highlighted that describe the parameter. Since this is specific to a commit the link keeps exisiting even though we might update the README and the line-numbers