Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions request-processor/src/application/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ def download_file(url, destination):
) as response:
with open(destination, "wb") as f:
f.write(response.read())
except HTTPError as e:
# 404s are expected (e.g. branch-fallback / optional CSVs); let the
# caller decide severity. Log other HTTP errors as errors.
if e.code == 404:
logger.warning(f"Not found (may be expected) {url}: {e}")
else:
logger.error(f"Failed to download {url}: {e}")
raise
except (socket.timeout, URLError) as e:
logger.error(f"Failed to download {url}: {e}")
raise
Expand Down