Skip to content

Commit

Permalink
fix(gateway): use generic requests exceptions
Browse files Browse the repository at this point in the history
Catch generic requests.exceptions.RequestException on information
retrieval from agents to avoid AttributeError with more specific
exceptions on old versions on Requests library.

fix #391
  • Loading branch information
rezib committed Nov 13, 2024
1 parent 08b61d9 commit b78680f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix compatibility issue with Requests >= 2.32.2 (#350).
- Return HTTP/404 not found with meaningful error message when requesting
unexisting node.
- gateway: catch generic `requests.exceptions.RequestException` when retrieving
information from agents to avoid `AttributeError` with more specific
exceptions on old versions on _Requests_ library (#391).
- frontend: Update dependencies to fix CVE-2024-45812 and CVE-2024-45811 (vite),
CVE-2024-47068 (rollup).

Expand Down
3 changes: 1 addition & 2 deletions slurmweb/apps/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ def agents(self):
logger.info("Retrieving info from agent at url %s", url.geturl())
agent = self._agent_info(url.geturl())
except (
requests.exceptions.ConnectionError,
requests.exceptions.JSONDecodeError,
requests.exceptions.RequestException,
SlurmwebAgentError,
) as err:
logger.error(
Expand Down

0 comments on commit b78680f

Please sign in to comment.