Skip to content
Snippets Groups Projects
Commit 2ed504a6 authored by Alan De Smet's avatar Alan De Smet
Browse files

Fix log levels/messages for failed filesets

If all of the filesets are NOT expected, it's okay, just log at INFO.

If any fileset IS expected, that's worrying and generates a WARNING.
ERROR is too severe because we might be able to continue, and there is a
good chance that the error is entirely remote.
parent 820a6e8e
Branches
No related tags found
No related merge requests found
...@@ -840,7 +840,6 @@ class Downloader: ...@@ -840,7 +840,6 @@ class Downloader:
logprogress(f"Attempt {attempt}") logprogress(f"Attempt {attempt}")
for fileset in filesets: for fileset in filesets:
description = fileset.description description = fileset.description
expected = fileset.expected
urls_to_files = fileset.urls_to_files urls_to_files = fileset.urls_to_files
logprogress(f" Working on {description}") logprogress(f" Working on {description}")
logging.info(f" files to get: {urls_to_files}") logging.info(f" files to get: {urls_to_files}")
...@@ -871,8 +870,13 @@ class Downloader: ...@@ -871,8 +870,13 @@ class Downloader:
if all_problems_are_missing_files(problems): if all_problems_are_missing_files(problems):
raise DownloadsFailedException(f"No usable {self.name} file set is present locally and downloads are disabled") raise DownloadsFailedException(f"No usable {self.name} file set is present locally and downloads are disabled")
logging.error("Unable to download any file set, reasons include:") any_file_is_expected = any([f.expected for f in filesets])
dump_problems(logging.error, problems) if any_file_is_expected:
logging.warning("Unable to download any file set, reasons include:")
dump_problems(logging.warning, problems)
else:
logging.info("It was expected that these file sets would not yet be available, and they aren't. Things we encountered while looking for them include:")
dump_problems(logging.info, problems)
try: try:
first = problems[0][0] first = problems[0][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment