Skip to content

Commit 8b40bc4

Browse files
committed
Handle httpx.HTTPStatusError in clients.py methods.
1 parent 45c383b commit 8b40bc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shellsmith/clients.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ async def get_health_status(self, **kwargs: Any) -> str:
635635
response = await self._request(method=method, path=path, **kwargs)
636636
data = response.json()
637637
return data["status"]
638-
except httpx.RequestError:
638+
except (httpx.RequestError, httpx.HTTPStatusError):
639639
return "DOWN"
640640

641641
async def is_healthy(self, **kwargs: Any) -> bool:
@@ -1323,7 +1323,7 @@ def get_health_status(self, **kwargs: Any) -> str:
13231323
response = self._request(method=method, path=path, **kwargs)
13241324
data = response.json()
13251325
return data["status"]
1326-
except httpx.RequestError:
1326+
except (httpx.RequestError, httpx.HTTPStatusError):
13271327
return "DOWN"
13281328

13291329
def is_healthy(self, **kwargs: Any) -> bool:

0 commit comments

Comments
 (0)