nextstrain / nextclade

Viral genome alignment, mutation calling, clade assignment, quality checks and phylogenetic placement

Home Page:https://clades.nextstrain.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty input file causes uncaught error in v3 (it didn't in v2)

corneliusroemer opened this issue · comments

Migrating ncov-ingest to v3, I noticed that v3 errors on empty input fasta file:

$ nextclade3 run test.fasta -d sars-cov-2 -t test.tsv
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: 
   0: Expected character '>' at record start.

Location:
   packages/nextclade/src/io/fasta.rs:106

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Location: packages/nextclade-cli/src/cli/nextclade_loop.rs:80

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
zsh: abort      nextclade3 run test.fasta -d sars-cov-2 -t test.tsv

In v2, the behaviour was to exit with exit code 0 and without anything written to stderr:

$ nextclade2 run test.fasta -d sars-cov-2 -t test.tsv                                                                    

Tested on v3.2.1