Skip to content

Commit

Permalink
add try/except in OID
Browse files Browse the repository at this point in the history
  • Loading branch information
Knispel2 committed Jun 25, 2024
1 parent 045c858 commit e8c5781
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fink_filters/filter_anomaly_notification/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,12 @@ def get_OID(ra, dec):
out: str
ZTF DR OID
'''

r = requests.get(
url=f'http://db.ztf.snad.space/api/v3/data/latest/circle/full/json?ra={ra}&dec={dec}&radius_arcsec=1'
)
try:
r = requests.get(
url=f'http://db.ztf.snad.space/api/v3/data/latest/circle/full/json?ra={ra}&dec={dec}&radius_arcsec=1'
)
except:
return None
if not status_check(r, 'get cross from snad'):
return None
oids = [key for key, _ in r.json().items()]
Expand Down

0 comments on commit e8c5781

Please sign in to comment.