Skip to content

Commit

Permalink
fix: make server genes/tx return empty page on missing gene (#385) (#387
Browse files Browse the repository at this point in the history
)
  • Loading branch information
holtgrewe authored Mar 4, 2024
1 parent eaa99ae commit f5d4a2f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/annotate/seqvars/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,12 @@ impl ProviderInterface for Provider {
}

fn get_tx_for_gene(&self, gene: &str) -> Result<Vec<TxInfoRecord>, Error> {
let tx_acs = self.get_picked_transcripts(gene).ok_or_else(|| {
tracing::warn!("gene ID not found {}", gene);
Error::NoGeneFound(gene.to_string())
})?;
let tx_acs = if let Some(tx_acs) = self.get_picked_transcripts(gene) {
tx_acs
} else {
tracing::warn!("no transcripts found for gene: {}", gene);
return Ok(Vec::default());
};

tx_acs
.iter()
Expand Down

0 comments on commit f5d4a2f

Please sign in to comment.