Skip to content

Commit

Permalink
CHK-60-checkexp-obj-request-error
Browse files Browse the repository at this point in the history
  • Loading branch information
jnau committed Jun 23, 2020
1 parent 5286e40 commit fb2ecec
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions checkexperiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,18 @@ def run(out, err, url, username, password, search_query, accessions_list=None, b
audit_request = session.get(urljoin(
url,
'/' + exp_accession + '?frame=page&format=json'))
audit_obj = audit_request.json().get('audit')
if audit_obj.get("ERROR"):
pass_audit = False
try:
audit_obj = audit_request.json().get('audit')
except ValueError as e:
err.write('{}\t{}\t{}\tValueError: {}\n'.format(
award_rfa,
assay_term_name,
exp_accession, e)
)
err.flush()
else:
if audit_obj.get("ERROR"):
pass_audit = False
except requests.exceptions.RequestException as e:
print (e)
continue
Expand Down

0 comments on commit fb2ecec

Please sign in to comment.