Skip to content

Commit c297de9

Browse files
committed
docs: add a clear message uppon ban
1 parent 8192801 commit c297de9

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ xmatch
6262
- the API is more flexible: you can now ommit the ``vizier:`` before the catalog name
6363
when crossmatching with a vizier table [#3194]
6464

65+
- add a help message when people are banned instead of returning error code 403 [#3225]
66+
6567
Infrastructure, Utility and Other Changes and Additions
6668
-------------------------------------------------------
6769

astroquery/xmatch/core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ def query_async(self, cat1, cat2, max_distance, *, colRA1=None, colDec1=None,
111111

112112
response = self._request(method='POST', url=self.URL, data=payload,
113113
timeout=self.TIMEOUT, cache=cache, **kwargs)
114+
115+
if response.status_code == 403:
116+
raise HTTPError("Your IP address has been banned from the XMatch server. "
117+
"This means that you sent too many cross-matching jobs in "
118+
"parallel to the service blocking other astronomers. Please"
119+
" contact the CDS team at cds-question[at]unistra.fr to "
120+
"find a solution.")
121+
114122
try:
115123
response.raise_for_status()
116124
except HTTPError as err:

docs/xmatch/xmatch.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ in the resulting table for demonstration purposes. Finally, ``colRa1`` and
7979
Troubleshooting
8080
===============
8181

82+
403 Forbidden
83+
-------------
84+
85+
If you are getting a 403 Forbidden error, then your IP address has been banned from
86+
XMatch's server. This means that you sent too many cross-matching jobs in parallel to
87+
the service blocking other astronomers. Please contact the CDS team at
88+
cds-question[at]unistra.fr to find a solution.
89+
90+
Out of date results
91+
-------------------
92+
8293
If you are repeatedly getting failed queries, or bad/out-of-date results, try clearing your cache:
8394

8495
.. code-block:: python

0 commit comments

Comments
 (0)