Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bug fixes #968

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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