Skip to content

Commit

Permalink
Change exception from RuntimeError to ValueError inside `Spond.get_ev…
Browse files Browse the repository at this point in the history
…ents()`
  • Loading branch information
Yannis-G committed Feb 21, 2025
1 parent 7c338db commit 946d62a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spond/spond.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ async def get_events(
Raises
------
RuntimeError
ValueError
Raised when the request to the API fails. This occurs if the response
status code indicates an error (e.g., 4xx or 5xx). The error message
includes the HTTP status code and the response body for debugging purposes.
Expand Down Expand Up @@ -319,7 +319,7 @@ async def get_events(
) as r:
if not r.ok:
error_details = await r.text()
raise RuntimeError(
raise ValueError(
f"Request failed with status {r.status}: {error_details}"
)
self.events = await r.json()
Expand Down

0 comments on commit 946d62a

Please sign in to comment.