GoogleSolarApiClient raises BuildingInsightsNotFoundError on 404 entity-not-found 🟩

This commit is contained in:
Daniel Roth 2026-05-21 15:52:52 +00:00
parent 573656be64
commit d1ca9be580

View file

@ -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)