mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
GoogleSolarApiClient raises BuildingInsightsNotFoundError on 404 entity-not-found 🟩
This commit is contained in:
parent
573656be64
commit
d1ca9be580
1 changed files with 6 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ class GoogleSolarApiClient:
|
||||||
result: dict[str, Any] = response.json()
|
result: dict[str, Any] = response.json()
|
||||||
return result
|
return result
|
||||||
except requests.exceptions.RequestException as e:
|
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
|
last_exc = e
|
||||||
time.sleep(2 ** attempt)
|
time.sleep(2 ** attempt)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue