Skip to content

Commit

Permalink
Broaden the error handling for httpx Exceptions (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaarthShah authored Oct 11, 2023
1 parent c1f99b9 commit f510a70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion netdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ async def get_data(self, url) -> Dict:
try:
async with httpx.AsyncClient() as client:
response = await client.get(str(url), timeout = self.timeout)
except httpx.ConnectError:
except httpx.TimeoutException:
raise
except httpx.TransportError:
raise exceptions.NetdataConnectionError(
f"Connection to {self.scheme}://{self.host}:{self.port} failed"
)
Expand Down

0 comments on commit f510a70

Please sign in to comment.