Skip to content

Commit

Permalink
🔊 Raise error if organism can't be created from bionty (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyosun authored Nov 19, 2024
1 parent 1eefa91 commit cb9c2da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bionty/_bionty.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def create_or_get_organism_record(
try:
# create a organism record from bionty reference
organism_record = Organism.from_source(name=organism)
if organism_record is None:
raise ValueError(
f"Organism {organism} can't be created from the bionty reference, check your spelling or create it manually."
)
# link the organism record to the default bionty source
organism_record.source = get_source_record(
bt_base.Organism(), Organism
Expand Down

0 comments on commit cb9c2da

Please sign in to comment.