Skip to content

Commit f510a70

Browse files
authored
Broaden the error handling for httpx Exceptions (home-assistant-ecosystem#17)
1 parent c1f99b9 commit f510a70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

netdata/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ async def get_data(self, url) -> Dict:
4444
try:
4545
async with httpx.AsyncClient() as client:
4646
response = await client.get(str(url), timeout = self.timeout)
47-
except httpx.ConnectError:
47+
except httpx.TimeoutException:
48+
raise
49+
except httpx.TransportError:
4850
raise exceptions.NetdataConnectionError(
4951
f"Connection to {self.scheme}://{self.host}:{self.port} failed"
5052
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy