@@ -234,9 +234,16 @@ def stage_data(self, uids):
234234 self ._staging_log ['initial_response' ] = response
235235 log .debug ("First response URL: {0}" .format (response .url ))
236236 if response .status_code == 405 :
237- raise HTTPError ("Received an error 405: this may indicate you "
238- "have already staged the data. Try downloading "
239- "the file URLs directly with download_files." )
237+ if hasattr (self ,'_last_successful_staging_log' ):
238+ log .warn ("Error 405 received. If you have previously staged "
239+ "the same UIDs, the result returned is probably "
240+ "correct, otherwise you may need to create a fresh "
241+ "astroquery.Alma instance." )
242+ return self ._last_successful_staging_log ['result' ]
243+ else :
244+ raise HTTPError ("Received an error 405: this may indicate you "
245+ "have already staged the data. Try downloading "
246+ "the file URLs directly with download_files." )
240247 response .raise_for_status ()
241248
242249 if 'j_spring_cas_security_check' in response .url :
@@ -310,6 +317,8 @@ def stage_data(self, uids):
310317 ))
311318 tbl = self ._json_summary_to_table (json_data , base_url = base_url )
312319 self ._staging_log ['result' ] = tbl
320+ self ._staging_log ['file_urls' ] = tbl ['URL' ]
321+ self ._last_successful_staging_log = self ._staging_log
313322
314323 return tbl
315324
0 commit comments