From d1ca9be5801b4f42297024dc62db97f3b6de3fcc Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 21 May 2026 15:52:52 +0000 Subject: [PATCH] =?UTF-8?q?GoogleSolarApiClient=20raises=20BuildingInsight?= =?UTF-8?q?sNotFoundError=20on=20404=20entity-not-found=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infrastructure/solar/google_solar_api_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/infrastructure/solar/google_solar_api_client.py b/infrastructure/solar/google_solar_api_client.py index 9112b980..28e91866 100644 --- a/infrastructure/solar/google_solar_api_client.py +++ b/infrastructure/solar/google_solar_api_client.py @@ -37,6 +37,12 @@ class GoogleSolarApiClient: result: dict[str, Any] = response.json() return result except requests.exceptions.RequestException as e: + if ( + e.response is not None + and e.response.status_code == 404 + and e.response.json()["error"]["message"] == self.ENTITY_NOT_FOUND_ERROR + ): + raise BuildingInsightsNotFoundError() from e last_exc = e time.sleep(2 ** attempt)