Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #968 from WildMeOrg/some_bug_fixes
Browse files Browse the repository at this point in the history
Some bug fixes
  • Loading branch information
TanyaStere42 authored Sep 17, 2024
2 parents 79d6dd1 + f2ec034 commit 1d1fc31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/modules/sightings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ def _parse_id_response(self, job_id_str, data):
sage_uuid = from_sage_uuid(target_annot_data['duuid'])
target_annot = Annotation.query.filter_by(content_guid=sage_uuid).first()
if not target_annot:
continue # this seems better than raising the exception (that kills fetching results)
raise HoustonException(
log,
f'Sage ID response with unknown target annot uuid {sage_uuid} for job {job_id_str}',
Expand All @@ -1493,6 +1494,7 @@ def _parse_id_response(self, job_id_str, data):
sage_uuid = from_sage_uuid(target_annot_data['duuid'])
target_annot = Annotation.query.filter_by(content_guid=sage_uuid).first()
if not target_annot:
continue # this seems better than raising the exception (that kills fetching results)
raise HoustonException(
log,
f'Sage ID response with unknown target annot uuid {sage_uuid} for job {job_id_str}',
Expand Down Expand Up @@ -1647,7 +1649,10 @@ def _heatmap_src(cls, extern_ref, q_annot_content_uuid, d_annot_content_uuid):
log.error(
f'non-image on fetching {sage_src} to {filepath}; contents in {filepath}.err'
)
open(filepath + '.err', 'wb').write(resp.content)
try:
open(filepath + '.err', 'wb').write(resp.content)
except Exception as ex:
log.error(f'writing {filepath}.err got error {str(ex)}')
return
try:
resp.raise_for_status()
Expand Down

0 comments on commit 1d1fc31

Please sign in to comment.