Skip to content

Commit

Permalink
Emit a 404 status when the seqfetcher endpoint fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaitodor committed Dec 14, 2023
1 parent 8f249c9 commit e0d2405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/utilities_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ def find_the_gene(range=None):


def seqfetcher(acc, start, end):
return SPDI_Normalization.get_ref_seq_subseq(acc, start, end)
try:
return SPDI_Normalization.get_ref_seq_subseq(acc, start, end)
except Exception as err:
print(f"Unexpected {err=}, {type(err)=}")
abort(404, 'Not Found')


def normalize_variant(variant):
Expand Down

0 comments on commit e0d2405

Please sign in to comment.