Skip to content

Commit 0864cb6

Browse files
committed
raise an exception if we find a cached file we can't validate
1 parent ad3e89f commit 0864cb6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

astroquery/query.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,7 @@ def _download_file(self, url, local_filepath, timeout=None, auth=None,
489489
else:
490490
# This case doesn't appear reachable under normal circumstances
491491
# It is not covered by tests, and probably indicates a badly-behaved server
492-
log.info(f"Found cached file {local_filepath}. Could not verify length.")
493-
response.close()
494-
return local_filepath
492+
raise ValueError(f"Found cached file {local_filepath}. Could not verify length.")
495493
else:
496494
open_mode = 'wb'
497495
if head_safe:

0 commit comments

Comments
 (0)