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)