Skip to content

Conversation

@SunilSimha
Copy link
Collaborator

Makes the user aware that SDSS Skyserver has failed as opposed to giving cryptic KeyErrors.

Example output:

In [21]: survey.get_catalog()
WARNING: Field info are not available for this data release [astroquery.sdss.field_names]
WARNING: Field info are not available for this data release [astroquery.sdss.field_names]
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[21], line 1
----> 1 survey.get_catalog()

File ~/Python/FRB/frb/surveys/sdss.py:94, in SDSS_Survey.get_catalog(self, photoobj_fields, timeout, print_query)
     92     return
     93 elif '<html>' in photom_catalog.colnames[0]:
---> 94     raise RuntimeError("SDSS photometry query appears to have failed. Error message: {}".format(photom_catalog.colnames[0]+photom_catalog[0][0]))
     96 # Now query for photo-z
     97 query = "SELECT GN.distance, "

RuntimeError: SDSS photometry query appears to have failed. Error message: <html><body><h1>503 Service Unavailable</h1>No server is available to handle this request.

@SunilSimha SunilSimha requested a review from bizarreboa October 31, 2025 22:30
Copy link
Contributor

@profxj profxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is helpful

@SunilSimha SunilSimha merged commit 14d9000 into main Nov 5, 2025
4 checks passed
@SunilSimha SunilSimha deleted the sdss_debug branch November 5, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants