From 77426f55cb9d0c24349eb5a2f3199c64c2b2b368 Mon Sep 17 00:00:00 2001 From: Matt Poole Date: Thu, 23 Jul 2026 15:07:17 +0100 Subject: [PATCH] don't show expected 404 as logger error --- request-processor/src/application/core/workflow.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/request-processor/src/application/core/workflow.py b/request-processor/src/application/core/workflow.py index c4721c3..1730df9 100644 --- a/request-processor/src/application/core/workflow.py +++ b/request-processor/src/application/core/workflow.py @@ -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