Skip to content

Commit

Permalink
Merge pull request #1022 from keflavich/alma-cleaner-error
Browse files Browse the repository at this point in the history
Raise an error when attempting to download private data without first logging in
  • Loading branch information
bsipocz authored Jan 25, 2018
2 parents c2ba678 + 28ba00f commit a5e78be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ def stage_data(self, uids):
timeout=self.TIMEOUT, cache=False)
self._staging_log['initial_response'] = response
log.debug("First response URL: {0}".format(response.url))
if 'login' in response.url:
raise ValueError("You must login before downloading this data set.")

if response.status_code == 405:
if hasattr(self, '_last_successful_staging_log'):
log.warning("Error 405 received. If you have previously staged "
Expand Down

0 comments on commit a5e78be

Please sign in to comment.