Skip to content

Commit f510a70

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

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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)