Skip to content

Commit e0d2405

Browse files
committed
Emit a 404 status when the seqfetcher endpoint fails
1 parent 8f249c9 commit e0d2405

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/utilities_endpoints.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ def find_the_gene(range=None):
195195

196196

197197
def seqfetcher(acc, start, end):
198-
return SPDI_Normalization.get_ref_seq_subseq(acc, start, end)
198+
try:
199+
return SPDI_Normalization.get_ref_seq_subseq(acc, start, end)
200+
except Exception as err:
201+
print(f"Unexpected {err=}, {type(err)=}")
202+
abort(404, 'Not Found')
199203

200204

201205
def normalize_variant(variant):

0 commit comments

Comments
 (0)