Seperate timeout errors in rest requests (#78710)

pull/78713/head
Joakim Sørensen 2022-09-18 21:38:27 +02:00 committed by GitHub
parent 8fd18cda30
commit 3655958d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,12 @@ class RestData:
)
self.data = response.text
self.headers = response.headers
except httpx.TimeoutException as ex:
if log_errors:
_LOGGER.error("Timeout while fetching data: %s", self._resource)
self.last_exception = ex
self.data = None
self.headers = None
except httpx.RequestError as ex:
if log_errors:
_LOGGER.error(